16.03.2016, 12:40
The nativechecker gives me this error in server_log.txt
What can I do to fix it?
OnVehicleSpawn code
public RL_OnGameModeInit code
zcmd_OnGameModeInit code
What can I do to fix it?
PHP код:
[14:31:02] [debug] Run time error 4: "Array index out of bounds"
[14:31:02] [debug] Accessing element at index 9 past array upper bound 8
[14:31:02] [debug] AMX backtrace:
[14:31:02] [debug] #0 0028b788 in ?? (1) from gm.amx
[14:31:02] [debug] #1 00064754 in ?? (1) from gm.amx
[14:31:02] [debug] #2 00017eb8 in public OnVehicleSpawn (1) from gm.amx
[14:31:02] [debug] #3 native SetVehicleToRespawn () from samp-server.exe
[14:31:02] [debug] #4 00057750 in ?? () from gm.amx
[14:31:02] [debug] #5 000175c0 in public RL_OnGameModeInit () from gm.amx
[14:31:02] [debug] #6 native CallLocalFunction () from samp-server.exe
[14:31:02] [debug] #7 0000ad6c in public zcmd_OnGameModeInit () from gm.amx
[14:31:02] [debug] #8 native CallLocalFunction () from samp-server.exe
[14:31:02] [debug] #9 00009250 in public SSCANF_OnGameModeInit () from gm.amx
[14:31:02] [debug] #10 000035b8 in public Itter_OnGameModeInit () from gm.amx
[14:31:02] [debug] #11 native CallLocalFunction () from samp-server.exe
[14:31:02] [debug] #12 00002874 in public ScriptInit_OnGameModeInit () from gm.amx
[14:31:02] [debug] #13 000017f8 in public OnGameModeInit () from gm.amx
PHP код:
public OnVehicleSpawn(vehicleid)
{
//new vehplatestr[128];
//format(vehplatestr, sizeof vehplatestr, "T:RP %i", vehicleid);
//SetVehicleNumberPlate(vehicleid, vehplatestr);
if(vehicleid != 509 && vehicleid != 481 && vehicleid != 510)
{
SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);
foreach(Player, i)
{
if(vehicleid == PlayerInfo[i][pVeh])
{
if(PlayerInfo[i][vLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
ChangeVehiclePaintjob(PlayerInfo[i][pVeh], PlayerInfo[i][vPJ]);
for(new x=0; x<14; i++)
{
AddVehicleComponent(PlayerInfo[i][pVeh], PlayerInfo[i][pVehMod][x]);
}
}
if(vehicleid == PlayerInfo[i][pVVeh])
{
if(PlayerInfo[i][vVLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
ChangeVehiclePaintjob(PlayerInfo[i][pVVeh], PlayerInfo[i][vVPJ]);
for(new x=0; x<14; i++)
{
AddVehicleComponent(PlayerInfo[i][pVVeh], PlayerInfo[i][pVVehMod][x]);
}
}
if(vehicleid == PlayerInfo[i][pBVeh])
{
if(PlayerInfo[i][vBLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
ChangeVehiclePaintjob(PlayerInfo[i][pBVeh], PlayerInfo[i][vBPJ]);
for(new x=0; x<14; i++)
{
AddVehicleComponent(PlayerInfo[i][pBVeh], PlayerInfo[i][pBVehMod][x]);
}
}
}
if(IsTruckerVehicle(vehicleid))
{
TruckPackages[vehicleid] = -1;
}
if(Siren[vehicleid])
{
Siren[vehicleid] = 0;
DestroyDynamicObject(SirenObject[vehicleid]);
DestroyDynamicObject(LightObject1[vehicleid]);
}
}
return 1;
}
PHP код:
public OnGameModeInit()
{
RL_OPUP = (funcidx("RL_OnPlayerUpdate") != -1);
RL_OPSC = (funcidx("RL_OnPlayerStateChange") != -1);
RL_OPKSC = (funcidx("RL_OnPlayerKeyStateChange") != -1);
RL_OPC = (funcidx("RL_OnPlayerConnect") != -1);
return (funcidx("RL_OnGameModeInit") != -1)?CallLocalFunction("RL_OnGameModeInit",""):1;
}
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit RL_OnGameModeInit
forward RL_OnGameModeInit();
PHP код:
public OnGameModeInit()
{
zcmd_g_HasOPCS = funcidx("OnPlayerCommandReceived") != -1;
zcmd_g_HasOPCE = funcidx("OnPlayerCommandPerformed") != -1;
if (funcidx("zcmd_OnGameModeInit") != -1)
{
return CallLocalFunction("zcmd_OnGameModeInit", "");
}
return 1;
}
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit zcmd_OnGameModeInit
forward zcmd_OnGameModeInit();