Array combined with virtual world isn't giving me the correct index.
#1

Basically what the title says, this code simply returns
Код:
[debug] Run time error 4: "Array index out of bounds"
[debug]  Attempted to read/write array element at negative index -1
[debug] AMX backtrace:
[debug] #0 00040bd8 in public OnPlayerKeyStateChange (0, 16, 0) from rp.amx
PHP код:
if(IsPlayerInRangeOfPoint(playerid2203.8129,-50.1708,1001.8047)) {
                                
SetTimerEx("UnfreezePlayer"3000false"i"playerid);
                                
TogglePlayerControllable(playeridfalse);
                                
SetPlayerPos(playeridClothes[2000-GetPlayerVirtualWorld(playerid)][scOutX], Clothes[2000-GetPlayerVirtualWorld(playerid)][scOutY], Clothes[2000-GetPlayerVirtualWorld(playerid)][scOutZ]); //assuming this is the faulty line
                                
SetPlayerInterior(playerid0);
                                
SetPlayerVirtualWorld(playerid0);
                                
cmd_me(playerid"exits the building.");
                            } 
This was how I set the world:
PHP код:
SetPlayerVirtualWorld(playeridi+2000); 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)