SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 23/01/2011, 06:56 AM   #1
r3k1lLz_
Big Clucker
 
Join Date: Jan 2010
Location: 127.0.0.1
Posts: 89
Reputation: 0
Default Random Question (100-1000)

Hey SA-MP,
Is it possible to randomize a number from 100-1000?
Can someone give me a source code if it is.
Cheers,
r3k
__________________
Code:
Filterscripts			     Maps                      Functions/Includes
Vote System	 	                                       Easy Helpbot
ChangeMyColour
r3k1lLz_ is offline  
Old 23/01/2011, 06:59 AM   #2
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,441
Reputation: 1620
Default Re: Random Question (100-1000)

pawn Code:
new Rand;
Rand = 10 + random(90);
Kwarde is offline  
Old 23/01/2011, 07:24 AM   #3
Retardedwolf
High-roller
 
Retardedwolf's Avatar
 
Join Date: Jun 2009
Posts: 1,468
Reputation: 60
Default Re: Random Question (100-1000)

new rand = random ( 900 ) + 100;
Retardedwolf is offline  
Old 23/01/2011, 07:26 AM   #4
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,441
Reputation: 1620
Default Re: Random Question (100-1000)

Ah yeah that's what I meanted :')
I did per accident 10-100 instead of 100-1000

pawn Code:
new Rand;
Rand = 100 + random(900);
Kwarde is offline  
Old 23/01/2011, 07:34 AM   #5
r3k1lLz_
Big Clucker
 
Join Date: Jan 2010
Location: 127.0.0.1
Posts: 89
Reputation: 0
Default Re: Random Question (100-1000)

So that's a random number betwwen 10 and 1000?
__________________
Code:
Filterscripts			     Maps                      Functions/Includes
Vote System	 	                                       Easy Helpbot
ChangeMyColour
r3k1lLz_ is offline  
Old 23/01/2011, 07:37 AM   #6
Retardedwolf
High-roller
 
Retardedwolf's Avatar
 
Join Date: Jun 2009
Posts: 1,468
Reputation: 60
Default Re: Random Question (100-1000)

Let me explain.

new rand - Create a new variable to store information in.
random ( 900 ) - Retrieves a random number between 0 and 900.
+ 100 - Adds 100 to it.
Retardedwolf is offline  
Old 23/01/2011, 07:57 AM   #7
r3k1lLz_
Big Clucker
 
Join Date: Jan 2010
Location: 127.0.0.1
Posts: 89
Reputation: 0
Default Re: Random Question (100-1000)

I see thanks
__________________
Code:
Filterscripts			     Maps                      Functions/Includes
Vote System	 	                                       Easy Helpbot
ChangeMyColour
r3k1lLz_ 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
Question about random .. Ben147 Help Archive 3 03/04/2010 01:59 PM
Question regarding random westre Help Archive 2 10/03/2010 03:28 PM
Random Question Fleeto Everything and Nothing 2 12/04/2009 05:17 PM
Random question Leoxide Help Archive 1 04/03/2009 06:24 PM


All times are GMT. The time now is 03:35 PM.


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