SA-MP Forums Archive
Random numbers - 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 numbers (/showthread.php?tid=219558)



Random numbers - Jimbo01 - 01.02.2011

I'm making a casino game... with random paying

new rand;
rand = random(300);

Example if numer 5 = he wins 50k... if number 10,20,150 = he wins 25k


The question is wich number will come hardly ? My jackpot numer is "1" its hard to get it.... i tested it wich numbers could be the same/hardly ?


Re: Random numbers - Vince - 01.02.2011

They all have the same chance to be chosen. That's why it is called RANDOM.
Random number - A number generated from a large set of numbers, using an algorithm that gives every number an equal probability of occurring.


Re: Random numbers - Niixie - 01.02.2011

Quote:
Originally Posted by Vince
Посмотреть сообщение
They all have the same chance to be chosen. That's why it is called RANDOM.
Random number - A number generated from a large set of numbers, using an algorithm that gives every number an equal probability of occurring.
You use it like this

pawn Код:
new rand = random([b]300[/b]);
The less the bolded number is, the bigger changes is there for winning.