AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   random_num() (https://forums.alliedmods.net/showthread.php?t=95286)

xbatista 06-22-2009 02:44

random_num()
 
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?

One 06-22-2009 03:02

Re: random_num()
 
PHP Code:

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

}

random_num0sizeof lol); 


Arkshine 06-22-2009 03:04

Re: random_num()
 
Loop random_num() and check if 4, you do random_num() again.

xbatista 06-22-2009 03:19

Re: random_num()
 
okey guys thanks for reply :]

SnoW 06-22-2009 05:32

Re: random_num()
 
Quote:

Originally Posted by arkshine (Post 853969)
Loop random_num() and check if 4, you do random_num() again.

PHP Code:

new num;
while( ( 
num random_num0) ) == ) { } 


xPaw 06-22-2009 05:43

Re: random_num()
 
It would look like it will do random while its not 4 :mrgreen:

PHP Code:

new num;
while( ( 
num random_num0) ) == ) { } 



All times are GMT -4. The time now is 15:27.

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