Raised This Month: $ Target: $400
 0% 

random_num()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-22-2009 , 02:44   random_num()
Reply With Quote #1

How to get random num of this chars?
random_num(0, 3, 5) - I know that is bad , how to get random num of 0,1,2,3,5?
Without including 4?
xbatista is offline
Send a message via Skype™ to xbatista
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-22-2009 , 03:02   Re: random_num()
Reply With Quote #2

PHP Code:
new lol[]=
{
    
"0",
    
"1",
    
"2",
    
"3",
    
"4",
    
"5"

}

random_num0sizeof lol); 
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-22-2009 , 03:04   Re: random_num()
Reply With Quote #3

Loop random_num() and check if 4, you do random_num() again.
__________________
Arkshine is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-22-2009 , 03:19   Re: random_num()
Reply With Quote #4

okey guys thanks for reply :]
xbatista is offline
Send a message via Skype™ to xbatista
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 06-22-2009 , 05:32   Re: random_num()
Reply With Quote #5

Quote:
Originally Posted by arkshine View Post
Loop random_num() and check if 4, you do random_num() again.
PHP Code:
new num;
while( ( 
num random_num0) ) == ) { } 

Last edited by SnoW; 06-22-2009 at 10:48.
SnoW is offline
Send a message via MSN to SnoW
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-22-2009 , 05:43   Re: random_num()
Reply With Quote #6

It would look like it will do random while its not 4

PHP Code:
new num;
while( ( 
num random_num0) ) == ) { } 
__________________
xPaw 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 15:27.


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