Help.... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help.... (
/showthread.php?tid=540389)
Help.... -
xStunt - 04.10.2014
Hi guys! Please help me!
Error:
[13:00:05] [debug] #0 0005ac74 in public OnPlayerTakeDamage () from rdm.amx
[13:00:09] [debug] Run time error 4: "Array index out of bounds"
[13:00:09] [debug] Accessing element at index 65535 past array upper bound 499
[13:00:09] [debug] AMX backtrace:
Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(kolokol[issuerid] == true) PlayerPlaySound(issuerid, 6401, 0.0, 0.0, 0.0);
if(PlayerInfo[issuerid][pGod] == 1) GameTextForPlayer(playerid, "~g~PLAYER HAS GOD MODE", 5000, 0);
return true;
}
Help
Re: Help.... -
Vince - 04.10.2014
The 65535 means INVALID_PLAYER_ID. It is used when the player takes damage from natural causes, such as falling. Put an INVALID_PLAYER_ID check before you use "issuerid" in an array.
Re: Help.... -
xStunt - 04.10.2014
Quote:
Originally Posted by Vince
The 65535 means INVALID_PLAYER_ID. It is used when the player takes damage from natural causes, such as falling. Put an INVALID_PLAYER_ID check before you use "issuerid" in an array.
|
Can you edit my code? Please