SA-MP Forums Archive
Random Question (100-1000) - 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 Question (100-1000) (/showthread.php?tid=215285)



Random Question (100-1000) - r3k1lLz_ - 23.01.2011

Hey SA-MP,
Is it possible to randomize a number from 100-1000?
Can someone give me a source code if it is.
Cheers,
r3k


Re: Random Question (100-1000) - Kwarde - 23.01.2011

pawn Код:
new Rand;
Rand = 10 + random(90);



Re: Random Question (100-1000) - Retardedwolf - 23.01.2011

new rand = random ( 900 ) + 100;


Re: Random Question (100-1000) - Kwarde - 23.01.2011

Ah yeah that's what I meanted :')
I did per accident 10-100 instead of 100-1000

pawn Код:
new Rand;
Rand = 100 + random(900);



Re: Random Question (100-1000) - r3k1lLz_ - 23.01.2011

So that's a random number betwwen 10 and 1000?


Re: Random Question (100-1000) - Retardedwolf - 23.01.2011

Let me explain.

new rand - Create a new variable to store information in.
random ( 900 ) - Retrieves a random number between 0 and 900.
+ 100 - Adds 100 to it.


Re: Random Question (100-1000) - r3k1lLz_ - 23.01.2011

I see thanks