SA-MP Forums Archive
RANDOM Numbers between 1-6 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: RANDOM Numbers between 1-6 (/showthread.php?tid=494325)



RANDOM Numbers between 1-6 - AwokenNeoX - 12.02.2014

the code to generate a number between 1 and 6


Re: RANDOM Numbers between 1-6 - Jimmy0wns - 12.02.2014

pawn Код:
random(6);



AW: Re: RANDOM Numbers between 1-6 - AwokenNeoX - 12.02.2014

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
pawn Код:
random(6);
thank you


Re: RANDOM Numbers between 1-6 - Konstantinos - 12.02.2014

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
pawn Код:
random(6);
That will return a number between 0-5 so you should add 1 on the result of it.

pawn Код:
random(6) + 1
the result will be now between 1-6.