Array Index Out of bounds - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Array Index Out of bounds (
/showthread.php?tid=613186)
Array Index Out of bounds -
Rockyyy - 25.07.2016
Hello im making Drive the van mission and i got some of these error when i reach the checkpoint
Code:
[15:20:23] [debug] Run time error 4: "Array index out of bounds"
[15:20:23] [debug] Accessing element at index 616 past array upper bound 7
[15:20:23] [debug] AMX backtrace:
[15:20:23] [debug] #0 00166f04 in public OnVehicleSpawn (vehicleid=616) at G:\pc3\0.3.7\gamemodes\GMMap.pwn:16851
[15:20:23] [debug] #1 native SetVehicleToRespawn () from samp-server.exe
[15:20:23] [debug] #2 0019662c in public VANCaptureCheck (playerid=0) at G:\pc3\0.3.7\gamemodes\GMMap.pwn:20091
[15:20:23] [debug] #3 000dd614 in public OnPlayerEnterDynamicCP (playerid=0, checkpointid=4) at G:\pc3\0.3.7\gamemodes\GMMap.pwn:7871
Code:
public OnVehicleSpawn(vehicleid)
{
for(new van; van < sizeof(VANPosition); van++)
{
if(vehicleid == VANVehicle[van])
{
VANDrived[vehicleid] = 0; ////// LINE 16851
break;
}
}
return 1;
}
SetVehicleToRespawn(VANVehicle[vehicle]); ////LINE 20091
VANCaptureCheck(playerid); /////line 7870
return 1; /////line 7871
Re: Array Index Out of bounds -
AbyssMorgan - 25.07.2016
PHP Code:
VANDrived[van] = 0;
Re: Array Index Out of bounds -
Rockyyy - 25.07.2016
Thank you