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



Array index out of bounds - TheHonnor - 18.10.2016

Hi yall, i have an error in my console and i dont know what should I do..

Photo: http://imageshack.com/a/img921/7831/T48Lpn.png

When i am spawning, everything is gonna be fine, but in console i have those errors/debugs.

Any tip may help me.


Re: " Array index out of bounds " - Konstantinos - 18.10.2016

The first thing comes to my mind is random function with a negative or zero value as parameter. Instead of guessing and searching what custom function that was called in OnPlayerSpawn has 2 parameters (playerid, something_else), you can compile with debug info* and get the exact line.

*Create pawn.cfg file (if you cannot get the extension, copy-paste server.cfg and rename it) into pawno folder and write -d3 in it. Re-compile your script (mss.pwn) and reproduce it to get the new results.


Re: Array index out of bounds - TheHonnor - 18.10.2016

Thanks for your tip. I will try in few minutes. I saw you said about a random function. My random function is "Spawn(playerid)" and it spawns you in a random place. Can this function cause those debugs?