Problem detected with crashdetect - 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: Problem detected with crashdetect (
/showthread.php?tid=624964)
Problem detected with crashdetect -
DarkChildren - 25.12.2016
Код:
[19:02:59] [debug] #0 00050be0 in public UpdatePlayerVelocimetro (1) from D79RP.amx
[19:02:59] [debug] Run time error 4: "Array index out of bounds"
[19:02:59] [debug] Accessing element at index 376 past array upper bound 107
[00:10:45] [debug] Run time error 4: "Array index out of bounds"
[00:10:45] [debug] Accessing element at index 14 past array upper bound 11
[00:10:45] [debug] AMX backtrace:
[00:10:45] [debug] #0 0003cc3c in public LoadPlayerData (4) from D79RP.amx
Someone could help me with these errors I found in the server.log, thanks to the crashdetect plugin
Re: Problem detected with crashdetect -
Lordzy - 25.12.2016
Check your codes under UpdatePlayerVelocimetro and LoadPlayerData. There are arrays under your callbacks that requires it size to be increased since higher valued indexes are used in it. If such a value is not supposed to happen, you should sanity check those. Since you haven't posted any of your code, I'd show an example:
pawn Код:
new
PlayerLoaded[15];
public LoadPlayer(playerid...) {
PlayerLoaded[playerid] = 1;
return 1;
}
The above code will work fine until "playerid" is less than 15. If it's 15 or exceeds the "PlayerLoaded" array size, you'll get the "Array index out of bounds" error. The fix that's to be done here is to increase "PlayerLoaded"'s size.