Raised This Month: $ Target: $400
 0% 

Perfect Random Nummer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 02-08-2010 , 17:14   Perfect Random Nummer
Reply With Quote #1

How do i generate a random number?
When i use random_num(1, 10); it usally gives the same number multiple times in a row.

Example:
/roll
Outcome: 1
/roll
Outcome: 1
/roll
Outcome: 1

When i want to make a random number its normaly because i want to check if a random number is 3 then do this and that, but always the three first ones gets either correct numbers or incorrect numbers.

Why is this? and how can i fix it?
NiQu is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-08-2010 , 17:23   Re: Perfect Random Nummer
Reply With Quote #2

This might help.
Exolent's Retrieving a Random Value from an Array without Using it More Than Once Guide
You'd probably need to modify the things in the tutorial to your need. For the array, make it like
PHP Code:
new array[4] = {
     
1,
     
2,
     
3,
     
4

__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 02-08-2010 , 17:25   Re: Perfect Random Nummer
Reply With Quote #3

Ill look into it.
NiQu is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 07:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode