SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 01/02/2011, 07:08 PM   #1
Jimbo01
Big Clucker
 
Join Date: Jul 2010
Posts: 154
Reputation: 1
Default Random numbers

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 ?
Jimbo01 is offline  
Old 01/02/2011, 07:10 PM   #2
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,090
Reputation: 2655
Default Re: Random numbers

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.
__________________
Vince is offline  
Old 01/02/2011, 08:45 PM   #3
Niixie
Gangsta
 
Niixie's Avatar
 
Join Date: Aug 2008
Location: Denmark
Posts: 523
Reputation: 3
Default Re: Random numbers

Quote:
Originally Posted by Vince View Post
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 Code:
new rand = random([b]300[/b]);

The less the bolded number is, the bigger changes is there for winning.
__________________
Code:
 ____      __    __    __    ___       ___    __    ________
|    \    |  |  |  |  |  |  \   \     /   /  |  |  |   _____|
|     \   |  |  |  |  |  |   \   \_ _/   /   |  |  |  |
|  |\  \  |  |  |  |  |  |    \    |    /    |  |  |  |__
|  | \  \ |  |  |  |  |  |    /   _|_   \    |  |  |   __|
|  |  \  \|  |  |  |  |  |   /   /   \   \   |  |  |  |_____
|__|   \_____|  |__|  |__|  /___/     \___\  |__|  |________|
Niixie is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] Random Numbers psoftware Help Archive 7 31/12/2010 07:14 PM
[Help] Random numbers Rainbow_Six Help Archive 4 21/10/2010 07:08 PM
Random Cellphone Numbers Torran Help Archive 1 02/04/2010 08:51 PM
[HELP] Random numbers? SiJ Help Archive 6 09/08/2009 03:14 PM
Need help with random numbers... *BueNoOo* Help Archive 11 18/06/2009 05:13 PM


All times are GMT. The time now is 08:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.