SA-MP Forums Archive
Pawno Compiler Crashing - 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: Pawno Compiler Crashing (/showthread.php?tid=139647)



Pawno Compiler Crashing - Torran - 05.04.2010

Hello,

I got the random spawns code of the wiki,
When i add it to my code, And try compile, It crashes my compiler,
Does anyone know why?


Re: Pawno Compiler Crashing - diamondo25 - 05.04.2010

Not when you don't post your code :P


Re: Pawno Compiler Crashing - dice7 - 05.04.2010

You forgot a bracket


Re: Pawno Compiler Crashing - Torran - 05.04.2010

Its copied and pasted of the wiki,
Nothings changed:

https://sampwiki.blast.hk/wiki/Random


Re: Pawno Compiler Crashing - dice7 - 05.04.2010

Like I said, you forgot a bracket


Re: Pawno Compiler Crashing - Torran - 05.04.2010

If i comment this then the compiler works,

pawn Код:
new rand = random(sizeof(ShipSpawns));



Re: Pawno Compiler Crashing - dice7 - 05.04.2010

The code on the wiki works fine with no crashes whatsoever.
You edited it and used the random() function outside of callbacks which caused the crash. You can't use functions outside callbacks


Re: Pawno Compiler Crashing - Torran - 05.04.2010

What function?

All i have is the new rand thing below my includes,
Then the Float:ShipSpawns or w/e tht holds all the coords
Then in ongamemodeinit i use the random on addplayerclass