/enter command bug
#1

Bugged Code
PHP код:
for(new 0MAX_DLABSi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid5.0DrugLabs[i][EntranceX], DrugLabs[i][EntranceY], DrugLabs[i][EntranceY]))
        {
            
SetPlayerPos(playeridDrugLabs[i][ExitX], DrugLabs[i][ExitY], DrugLabs[i][ExitZ]);
            
SetPlayerInterior(playeridDrugLabs[i][Interior]);
            
SetPlayerVirtualWorld(playeridDrugLabs[i][VirtualWorld]);
            
TogglePlayerControllable(playerid0);
            
SetTimerEx("IntLoading"2500false"i"playerid);
            
PlayerTextDrawShow(playeridentranceloading[0][playerid]);
            
PlayerTextDrawShow(playeridentranceloading[1][playerid]);
        }
    } 
Nothing happens if I type the /enter command near a druglab.


But this is working and it is the same:
PHP код:
for(new 0MAX_BUILDINGSi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid5.0BuildingInfo[i][bEntranceX], BuildingInfo[i][bEntranceY], BuildingInfo[i][bEntranceZ]))
        {
            new 
string[65];
            
SetPlayerPos(playeridBuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]);
            
SetPlayerInterior(playeridBuildingInfo[i][bInt]);
            
SetPlayerVirtualWorld(playeridBuildingInfo[i][bVW]);
            
TogglePlayerControllable(playerid0);
            
SetTimerEx("IntLoading"2500false"i"playerid);
            
PlayerTextDrawShow(playeridentranceloading[0][playerid]);
            
PlayerTextDrawShow(playeridentranceloading[1][playerid]);
            if(
PlayerInfo[playerid][pLanguage] == 1)
            {
                
format(stringsizeof(string), "You have entered the building with ID: "COL_WHITE"%d"BuildingInfo[i][ID]);
                
SendClientMessage(playeridCOLOR_GREENstring);
                break;
            }
            else
            {
                
format(stringsizeof(string), "Ai intrat in cladirea cu IDul: "COL_WHITE"%d"BuildingInfo[i][ID]);
                
SendClientMessage(playeridCOLOR_GREENstring);
                break;
            }
        }
    } 
Reply
#2

Add a break because it keeps doing the loop.
Reply
#3

Check if it works when you swap the EntranceXYZ and ExitXYZ and ye
add break;
Reasons for the command to show anything is because he is not near any lab. You might've messed up the coordinates or Enter/Exit. Check if its correct..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)