SA-MP Forums Archive
Random num? o_o - 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: Random num? o_o (/showthread.php?tid=120863)



Random num? o_o - Hot - 13.01.2010

I can't understand what's wrong with this piece of code:

Код:
new randnum = 1000 + random(8999);
new voonum = randnum;
it "crashes" my pawno. (It says the instruction can't be "read").

Please, i really need help at this


Re: Random num? o_o - Babul - 13.01.2010

the random() function is called at top of your script, try:
top of script
Код:
new randnum;
new voonum;
inside any function()
Код:
randnum=1000+random(8999);
voonum=randnum;



Re: Random num? o_o - Calgon - 13.01.2010

Why don't you just do

Код:
new voonum = 8999+random(8999);