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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random (
/showthread.php?tid=271242)
Random -
antonio112 - 23.07.2011
Hey ... Sorry for post this here, I know I should've PM
****** about this but anyhow. I remember
****** had a function, that used to random from a minimum number to a maximum.
It was something like:
pawn Код:
rand(min, max)
//example:
rand(100, 1000) // Would give a random number from 100 to 1000.
I can't remember exactly what it was like so, if anyone has any idea how it was, I would appreciate it.
Thanks.
Re: Random -
MoroDan - 23.07.2011
Quote:
Originally Posted by antonio112
Hey ... Sorry for post this here, I know I should've PM ****** about this but anyhow. I remember ****** had a function, that used to random from a minimum number to a maximum.
It was something like:
pawn Код:
rand(min, max) //example: rand(100, 1000) // Would give a random number from 100 to 1000.
I can't remember exactly what it was like so, if anyone has any idea how it was, I would appreciate it.
Thanks.
|
PHP код:
#define randomize(%1,%2) random(%2-%1)+%1
Re: Random -
antonio112 - 23.07.2011
MoroDan, that should do it, thanks.