Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

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

$
0
0
Basically what the title says, this code simply returns
Code:

[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 Code:

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 Code:

SetPlayerVirtualWorld(playeridi+2000); 


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>