SA-MP Forums Archive
Wierd Problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Wierd Problem (/showthread.php?tid=98853)



Wierd Problem - Anwix - 23.09.2009

I've just started having a very wierd, and annoying problem on my script, i have around 600+ lines under OnGameModeInit, and nothing is loading no more, only up to a certain point, my classes are loading, and with my cars been at the bottom of OnGameModeInit, they dont load at all, along with tonnes of other stuff!

I was wondering if there was a limit of how much you can put under OnGameModeInit, and if anyone has had this problem?


Re: Wierd Problem - member - 23.09.2009

check if you have any returns somwhere in OnGameModeInit - it will stop executing the rest of the code.


Re: Wierd Problem - Peter_Corneile - 23.09.2009

Are you using a GM that you took from the forum ?


Re: Wierd Problem - Anwix - 23.09.2009

@ Hustler:
The only return i have is righhttttt at the bottom of OnGameModeInit "return 1;"


@Peter:
No its my own script.


Re: Wierd Problem - dice7 - 23.09.2009

Set debug messages every ~10 lines


Re: Wierd Problem - Anwix - 23.09.2009

I did a few "print("1");" and 2, 3, 4 and found it doesnt complete the whole lot, stops after a few vehicles are created and misses out alot of lines.
Im really confused.

Edit: Stops after 173 lines.


Re: Wierd Problem - member - 23.09.2009

show us the code slightly before the last successfull print and the rest of it thereon.


Re: Wierd Problem - Anwix - 23.09.2009

http://www.leelad.pastebin.com/d42eab254

This is the part the seems to kill the Init.
I get my "Created Buyable vehicle id 13." then it stops.


Re: Wierd Problem - Donny_k - 23.09.2009

Make sure you are still in the boundry for the array, if it's thirteen then you are one over already etc.

pawn Код:
new
  array[ 5 ];

for ( new i; i !=6; i ++ )
{
  array[ i ] = 1;
}
That will kill the script on the last itteration as the array is only five cells (0,1,2,3,4) and the loop would be trying to access the sixth one (4,5 << 5 doesn't exist).


Re: Wierd Problem - Anwix - 23.09.2009

I've managed to fix this, overall it was 2 of my includes with carelessness mistakes in them, thanks for all who helped.