SA-MP Forums Archive
Array index out of bounds OnGameModeInit - 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: Array index out of bounds OnGameModeInit (/showthread.php?tid=527133)



Array index out of bounds OnGameModeInit - maximthepain - 21.07.2014

Hello there, anyone can tell me why this is happening? I know that MAX_VEHICLES is 2000 so there might be something under OnGameModeInit that isn't checked with INVALID_VEHICLE_ID?
I would like to to mention that this problem accours in the middle of OnGameModeInit code and the rest of the code isn't executed at all.
pawn Код:
[05:06:16] [debug] Run time error 4: "Array index out of bounds"
[05:06:16] [debug]  Accessing element at index 65535 past array upper bound 1999
[05:06:16] [debug] AMX backtrace:
[05:06:16] [debug] #0 0003dda4 in ?? () from LG-RP.amx
[05:06:16] [debug] #1 0006b694 in public IRC_OnGameModeInit () from LG-RP.amx
[05:06:16] [debug] #2 native CallLocalFunction () [00472e50] from samp-server.exe
[05:06:16] [debug] #3 00025958 in public RL_OnGameModeInit () from LG-RP.amx
[05:06:16] [debug] #4 native CallLocalFunction () [00472e50] from samp-server.exe
[05:06:16] [debug] #5 00024908 in ?? () from LG-RP.amx
[05:06:16] [debug] #6 0000d008 in public Itter_OnGameModeInit () from LG-RP.amx
[05:06:16] [debug] #7 native CallLocalFunction () [00472e50] from samp-server.exe
[05:06:16] [debug] #8 00008018 in public ScriptInit_OnGameModeInit () from LG-RP.amx
[05:06:16] [debug] #9 00006f9c in public zcmd_OnGameModeInit () from LG-RP.amx
[05:06:16] [debug] #10 native CallLocalFunction () [00472e50] from samp-server.exe
[05:06:16] [debug] #11 00006a90 in public SSCANF_OnGameModeInit () from LG-RP.amx
[05:06:16] [debug] #12 native CallLocalFunction () [00472e50] from samp-server.exe
[05:06:16] [debug] #13 00000d6c in public OnGameModeInit () from LG-RP.amx



Re: Array index out of bounds OnGameModeInit - Scottas - 21.07.2014

Show ongamemodeinit callback


Re: Array index out of bounds OnGameModeInit - Jack_Leslie - 21.07.2014

You have to show us the code so we can see what you have done wrong.


Re: Array index out of bounds OnGameModeInit - Konstantinos - 21.07.2014

Invalid modelid would return INVALID_VEHICLE_ID.

Compile with debug info so you can get the exact line: https://github.com/Zeex/samp-plugin-...ith-debug-info


Re: Array index out of bounds OnGameModeInit - maximthepain - 21.07.2014

Nevermind I found the problem, thanks anyway everyone.
my plugins were out of date and after updating them the problem accour.
I had to check the script & delete the unneccery stuff. Therefore after debuging for a while it just stopped show the warning and the gamemode fully loaded.