01.01.2017, 07:52
Hello
OnPlayerEnterCheckpoint
EDIT: Why i got those errors ?
PHP код:
[09:25:17] [debug] Run time error 4: "Array index out of bounds"
[09:25:17] [debug] Attempted to read/write array element at index 65535 in array of size 100
[09:25:17] [debug] AMX backtrace:
[09:25:17] [debug] #0 00098364 in public FC_OnPlayerDeath (0, 65535, 255) from TDM.amx
[09:25:17] [debug] #1 native CallLocalFunction () from samp03svr
[09:25:17] [debug] #2 0000e3e8 in public OnPlayerDeath (0, 65535, 255) from TDM.amx
[09:25:17] [death] [H]e[R]o died 255
PHP код:
[09:09:44] [debug] AMX backtrace:
[09:09:44] [debug] #0 0016201c in public OnPlayerEnterCheckpoint (0) from TDM.amx
[09:11:27] [debug] Run time error 4: "Array index out of bounds"
[09:11:27] [debug] Attempted to read/write array element at index 5 in array of size 5
[09:11:27] [debug] AMX backtrace:
[09:11:27] [debug] #0 0016201c in public OnPlayerEnterCheckpoint (0) from TDM.amx
[09:12:15] [debug] Run time error 4: "Array index out of bounds"
[09:12:15] [debug] Attempted to read/write array element at index 5 in array of size 5
[09:12:15] [debug] AMX backtrace:
[09:12:15] [debug] #0 0016201c in public OnPlayerEnterCheckpoint (0) from TDM.amx
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
new text[128];
if(IsCapturing[playerid][usapro] == 1)
{
if(IsPlayerInVehicle(playerid, usapro))
{
DisablePlayerCheckpoint(playerid);
IsCapturing[playerid][usapro] = 0;
format(text, sizeof(text), "~r~%s~w~ has Captured ~r~USA prototype ~w~for his team!", pName(playerid));
RemovePlayerFromVehicle(playerid);
SCM(playerid, C_GREEN, "Congratulations! You got +6 score and +6000 cash!");
GivePlayerMoney(playerid, 6000);
SetVehicleToRespawn(usapro);
SetPlayerScore(playerid, GetPlayerScore(playerid)+6);
TogglePlayerAllDynamicCPs(playerid, 1);
TextStats(playerid);
Savestatus(playerid);
}
else
{
DisablePlayerCheckpoint(playerid);
SCM(playerid, RED, "You're not in the USA Prototype.");
}
}
if(IsCapturing[playerid][auspro] == 1)
{
if(IsPlayerInVehicle(playerid, auspro))
{
DisablePlayerCheckpoint(playerid);
IsCapturing[playerid][auspro] = 0;
TextStats(playerid);
Savestatus(playerid);
format(text, sizeof(text), "~r~%s~w~ has Captured ~r~ Australia prototype ~w~for his team!", pName(playerid));
RemovePlayerFromVehicle(playerid);
SCM(playerid, C_GREEN, "Congratulations! You got +6 score and +6000 cash!");
GivePlayerMoney(playerid, 6000);
SetVehicleToRespawn(auspro);
SetPlayerScore(playerid, GetPlayerScore(playerid)+6);
TogglePlayerAllDynamicCPs(playerid, 1);
}
else
{
DisablePlayerCheckpoint(playerid);
SCM(playerid, RED, "You're not in the Australia Prototype.");
}
}
if(IsCapturing[playerid][arabpro] == 1)
{
if(IsPlayerInVehicle(playerid, arabpro))
{
DisablePlayerCheckpoint(playerid);
IsCapturing[playerid][arabpro] = 0;
TextStats(playerid);
Savestatus(playerid);
format(text, sizeof(text), "~r~%s~w~ has Captured ~r~Arabian prototype ~w~for his team!", pName(playerid));
RemovePlayerFromVehicle(playerid);
SCM(playerid, C_GREEN, "Congratulations! You got +6 score and +6000 cash!");
GivePlayerMoney(playerid, 6000);
SetVehicleToRespawn(arabpro);
SetPlayerScore(playerid, GetPlayerScore(playerid)+6);
TogglePlayerAllDynamicCPs(playerid, 1);
}
else
{
DisablePlayerCheckpoint(playerid);
SCM(playerid, RED, "You're not in the Arabian Prototype.");
}
}
if(IsCapturing[playerid][sovpro] == 1)
{
if(IsPlayerInVehicle(playerid, sovpro))
{
DisablePlayerCheckpoint(playerid);
RemovePlayerFromVehicle(playerid);
TextStats(playerid);
Savestatus(playerid);
format(text, sizeof(text), "~r~%s~w~ has Captured ~r~Soviet prototype ~w~for his team!", pName(playerid));
IsCapturing[playerid][sovpro] = 0;
SCM(playerid, C_GREEN, "Congratulations! You got +6 score and +6000 cash!");
GivePlayerMoney(playerid, 6000);
SetVehicleToRespawn(sovpro);
SetPlayerScore(playerid, GetPlayerScore(playerid)+6);
TogglePlayerAllDynamicCPs(playerid, 1);
}
else
{
DisablePlayerCheckpoint(playerid);
SCM(playerid, RED, "You're not in the Soviet Prototype.");
}
}
if(IsCapturing[playerid][eurapro] == 1)
{
if(IsPlayerInVehicle(playerid, eurapro))
{
DisablePlayerCheckpoint(playerid);
format(text, sizeof(text), "~r~%s~w~ has Captured ~r~Erusia prototype ~w~for his team!", pName(playerid));
IsCapturing[playerid][eurapro] = 0;
RemovePlayerFromVehicle(playerid);
TextStats(playerid);
Savestatus(playerid);
SCM(playerid, C_GREEN, "Congratulations! You got +6 score and +6000 cash!");
GivePlayerMoney(playerid, 6000);
SetVehicleToRespawn(eurapro);
SetPlayerScore(playerid, GetPlayerScore(playerid)+6);
TogglePlayerAllDynamicCPs(playerid, 1);
}
else
{
DisablePlayerCheckpoint(playerid);
SCM(playerid, RED, "You're not in the Erusia Prototype.");
}
}
return 1;
}