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



Random. - audriuxxx - 07.08.2013

Hi,

Can i generate random number from variable?

new ASDAs = 10;

new RANDOMNUMBER = random( ASDAs);


Re: Random. - -Prodigy- - 07.08.2013

You got it correct..

pawn Код:
new var = 10, randnum = random(var);
printf("Random number: %d", randnum);



Re: Random. - Youarex - 07.08.2013

As long as the argument is an integer type. You could test it yourself using https://sampwiki.blast.hk/wiki/Printf, as shown in Prodigy's example.