SA-MP Forums Archive
Requesting an explanation/fix - 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: Requesting an explanation/fix (/showthread.php?tid=635089)



Requesting an explanation/fix - NealPeteros - 01.06.2017

Код:
[15:28:05] [debug] Run time error 4: "Array index out of bounds"
[15:28:05] [debug]  Accessing element at index 16 past array upper bound 15
[15:28:05] [debug] AMX backtrace:
[15:28:05] [debug] #0 00041e54 in public ELC_AC_OnGameModeInit (0) from Roleplay.amx
[15:28:05] [debug] #1 native CallLocalFunction () from samp-server.exe
[15:28:05] [debug] #2 000231bc in public SSCANF_OnGameModeInit () from Roleplay.amx
[15:28:05] [debug] #3 00011640 in public Itter_OnGameModeInit () from Roleplay.amx
[15:28:05] [debug] #4 native CallLocalFunction () from samp-server.exe
[15:28:05] [debug] #5 00010be0 in ?? () from Roleplay.amx
[15:28:05] [debug] #6 000056d4 in public ScriptInit_OnGameModeInit () from Roleplay.amx
[15:28:05] [debug] #7 00000b0c in public zcmd_OnGameModeInit () from Roleplay.amx
[15:28:05] [debug] #8 native CallLocalFunction () from samp-server.exe
[15:28:05] [debug] #9 00000600 in public OnGameModeInit () from Roleplay.amx



Re: Requesting an explanation/fix - CrossUSAAF - 01.06.2017

You exceed an array somewhere in OnGameModeInit callback, probably in a loop.

The same error occurs in the following example:
new array[10];
printf("%d", array[10]);
You may only access indexes 0-9.


Re: Requesting an explanation/fix - NealPeteros - 01.06.2017

Quote:
Originally Posted by CrossUSAAF
Посмотреть сообщение
You exceed an array somewhere in OnGameModeInit callback, probably in a loop.

The same error occurs in the following example:
new array[10];
printf("%d", array[10]);
You may only access indexes 0-9.
Took me long enough, but yeah, I got it, thanks!