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=463856)



Random(); - Ahrim - 14.09.2013

Hi,

Is there any way to set minimum of Random(); instead of it being 1 to, for example, 20 if I did Random(20);
would something like Random(5-20); does the job or it'll set it's max to 15 only?

Thanks.


Re: Random(); - Konstantinos - 14.09.2013

pawn Код:
stock RandomEx(min, max)
{
    return random(max - min) + min;
}



Re: Random(); - Ahrim - 14.09.2013

ah, thanks!