Array Index Out of bounds
#1

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
Reply
#2

PHP Code:
VANDrived[van] = 0
Reply
#3

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)