08.07.2017, 06:43
Please help wit this error
pawn Код:
[06:17:30] [debug] Run time error 4: "Array index out of bounds"
[06:17:30] [debug] Attempted to read/write array element at index 255 in array of size 255
[06:17:30] [debug] AMX backtrace:
[06:17:30] [debug] #0 00082b7c in public OnVehicleSpawn (vehicleid=255) at #:\Hidden\Hidden\gamemodes\Hidden.pwn:11707
[06:17:30] [debug] #1 native SetVehicleToRespawn () from samp03svr
[06:17:30] [debug] #2 000c1e6c in LoadVehicle (i=255) at #:\Hidden\Hidden\gamemodes\Hidden.pwn:16345
[06:17:30] [debug] #3 000c0630 in LoadVehicles () at #:\Hidden\Hidden\gamemodes\Hidden.pwn:16292
[06:17:30] [debug] #4 00089544 in public zcmd_OnGameModeInit () at #:\Hidden\Hidden\gamemodes\Hidden.pwn:12246
[06:17:30] [debug] #5 native CallLocalFunction () from samp03svr
[06:17:30] [debug] #6 00009e0c in public IRC_OnGameModeInit () at #:\Hidden\Hidden\pawno\include\zcmd.inc:51
[06:17:30] [debug] #7 native CallLocalFunction () from samp03svr
[06:17:30] [debug] #8 000098b8 in public OnGameModeInit () at #:\Hidden\Hidden\pawno\include\irc.inc:200
[06:17:30] [debug] Run time error 4: "Array index out of bounds"
[06:17:30] [debug] Attempted to read/write array element at index 256 in array of size 255
pawn Код:
public OnVehicleSpawn(vehicleid)
{
if(vehicleid>sizeof(Vehicles)) return DestroyVehicle(vehicleid);
vTrailer[vehicleid] = 0;
CarBombActive[vehicleid] = 0;
vehicleGuns[vehicleid] = 0;
vehicleBullets[vehicleid] = 0;
for(new i=0;i<13;i++)
{
VehicleWeapon[vehicleid][i] = 0;
VehicleAmmo[vehicleid][i] = 0;
}
HasGunCrates[vehicleid] = 0;
HasBulletCrates[vehicleid] = 0;
comps[vehicleid][guns] = 0;
comps[vehicleid][oil] = 0;
comps[vehicleid][alchool] = 0;
comps[vehicleid][money] = 0;
comps[vehicleid][drugs] = 0;
comps[vehicleid][stuffs] = 0;
compscar[vehicleid] = 0; //line 11707
}