SA-MP Forums Archive
Run time error 4: "Array index out of bounds" - 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: Run time error 4: "Array index out of bounds" (/showthread.php?tid=457177)



Run time error 4: "Array index out of bounds" - Kalli749 - 09.08.2013

Hi guys!

I get Error when i start my server. I din't changed anything at my script..
I hope someone can help me


Код:
[18:25:08] [debug] Run time error 4: "Array index out of bounds"
[18:25:08] [debug]   Accessing element at index 44 past array upper bound 43
[18:25:08] [debug] Backtrace (most recent call first):
[18:25:08] [debug] #0  0001e098 in zcmd_OnGameModeInit () from pb24n.amx
[18:25:08] [debug] #1  ???????? in native CallLocalFunction () from samp-server.exe
[18:25:08] [debug] #2  0000b674 in SSCANF_OnGameModeInit () from pb24n.amx
[18:25:08] [debug] #3  ???????? in native CallLocalFunction () from samp-server.exe
[18:25:08] [debug] #4  00001420 in Streamer_OnGameModeInit () from pb24n.amx
[18:25:08] [debug] #5  ???????? in native CallLocalFunction () from samp-server.exe
[18:25:08] [debug] #6  0000098c in OnGameModeInit () from pb24n.amx
Best regards


Re: Run time error 4: "Array index out of bounds" - Misiur - 09.08.2013

Are you sure you didn't change anything? Somewhere your script is trying to access 44 index of array where last index is 43. Either you are doing it directly (via array[44]), or you have somewhere loop with off-by-one error (like for(new i = 0; i <= sizeof array; ++i))


Re: Run time error 4: "Array index out of bounds" - Konstantinos - 09.08.2013

Compile with debug mode for extra information: http://forum.sa-mp.com/showpost.php?...32&postcount=7

Most of the times, is shows the line occurs it.