SA-MP Forums Archive
random(integer) - 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(integer) (/showthread.php?tid=488442)



random(integer) - AnonScripter - 18.01.2014

random(5);

does this include 'zero' too ??


Re: random(integer) - Babul - 18.01.2014

yes. the result will be a number from 0 to n-1 (inclusive), therefore the 5 is omitted.

it might help to take the parameter as a modulus operator for easy remembering


Re: random(integer) - AnonScripter - 18.01.2014

thank you