Crashdetect (debug) - 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: Crashdetect (debug) (
/showthread.php?tid=614160)
Crashdetect (debug) -
Penguin1997 - 05.08.2016
Код:
[12:17:20] [debug] Run time error 4: "Array index out of bounds"
[12:17:20] [debug] Accessing element at index 29 past array upper bound 24
[12:17:20] [debug] AMX backtrace:
[12:17:20] [debug] #0 000be9e4 in ?? (... <3 arguments>) at G:\ZS\gamemodes\gamemodes\bttdmzmapocalypse.pwn:8943
[12:17:20] [debug] #1 0000f5e0 in public OnPlayerDeath (playerid=29, killerid=20, reason=25) at G:\ZS\pawno\include\YSI\y_hooks/impl.inc:753
[12:17:20] [debug] [12:17:38] [debug] Run time error 4: "Array index out of bounds"
[12:17:38] [debug] Accessing element at index 25 past array upper bound 24
[12:17:38] [debug] AMX backtrace:
[12:17:38] [debug] #0 000be9e4 in ?? (... <3 arguments>) at G:\ZS\gamemodes\gamemodes\bttdmzmapocalypse.pwn:8943
[12:17:38] [debug] #1 0000f5e0 in public OnPlayerDeath (playerid=25, killerid=65535, reason=54) at G:\ZS\pawno\include\YSI\y_hooks/impl.inc:753
I'm using YSI 3.1 and seems like its coming from impl.inc ? what could be it ?
Re: Crashdetect (debug) -
Konstantinos - 05.08.2016
Post line 8943 from bttdmzmapocalypse.pwn and 5 lines before and after. From what I see in the logs, there's an array with size of 25 and you use "playerid" as index. Finding the array and changing its value to MAX_PLAYERS would probably solve it.
Re: Crashdetect (debug) -
Penguin1997 - 05.08.2016
-solved-
Re: Crashdetect (debug) -
Konstantinos - 05.08.2016
And how is "DeathSpam" defined? It should be:
pawn Код:
new DeathSpam[MAX_PLAYERS];
Re: Crashdetect (debug) -
Penguin1997 - 05.08.2016
Quote:
Originally Posted by Konstantinos
And how is "DeathSpam" defined? It should be:
pawn Код:
new DeathSpam[MAX_PLAYERS];
|
It was
Код:
new DeathSpam[MAX_PLAYERS char];
new LastDeath[MAX_PLAYERS];
Re: Crashdetect (debug) -
jlalt - 05.08.2016
Quote:
Originally Posted by Penguin1997
It was
Код:
new DeathSpam[MAX_PLAYERS char];
new LastDeath[MAX_PLAYERS];
|
he meant it should be
PHP код:
new DeathSpam[MAX_PLAYERS];
char word is bugging it....
Re: Crashdetect (debug) -
Konstantinos - 05.08.2016
If you want to use packed-arrays, then you should use {index} instead of [index] such as:
pawn Код:
default: DeathSpam{playerid} = 0;
Re: Crashdetect (debug) -
Penguin1997 - 05.08.2016
Quote:
Originally Posted by Konstantinos
And how is "DeathSpam" defined? It should be:
pawn Код:
new DeathSpam[MAX_PLAYERS];
|
Right I will test it with it and will come with results in few mins.
Re: Crashdetect (debug) -
Penguin1997 - 05.08.2016
Thanks, seems like that was the only problem causing it.