Crashdetect - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Crashdetect (
/showthread.php?tid=395503)
Crashdetect -
Blackazur - 26.11.2012
Hello, i used the crashdetect-plugin and i would ask what does that mean?
Код:
[18:37:37] [debug] Run time error 4: "Array index out of bounds"
[18:37:37] [debug] Accessing element at index 65535 past array upper bound 49
[18:37:37] [debug] AMX backtrace:
[18:37:37] [debug] #0 00044a5c in public OnPlayerTakeDamage ()
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(PlayerTeam[playerid] != PlayerTeam[issuerid])
{
new Float:hp;
new Float:armour;
GetPlayerHealth(playerid,hp);
GetPlayerArmour(playerid,armour);
switch(weaponid)
{
case 4: // Knife
{
if(armour > 0.0)
{
SetPlayerArmour(playerid,armour-50.0);
}
else
{
SetPlayerHealth(playerid,hp-45.0);
}
}
}
}
return 1;
}
Re: Crashdetect -
3ventic - 30.11.2012
Check that both playerid and issuerid are connected players. If they're not, the array doesn't have a value at that index and it will crash the server.