Raised This Month: $ Target: $400
 0% 

fail


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 07-23-2011 , 12:56   Re: Help with random_num and players
Reply With Quote #1

PHP Code:
public round_start() { 
     
    new 
modo random_num(012
     
    switch(
modo)  
    { 
        case 
1modo_lottery() 
        case 
2modo_normal() 
    } 

Well, you random num goes from 0 to 12, but in the switch statement you have only 2 cases, so probably your cases are never choosen.


Spanish:
----------
Digo que te fijes que el random_num va de 0 a 12, y que tu has puesto que solo haga algo si sale un 1 o 2, asi que tal vez al hacer el random_num nunca ha salido el 1 o 2...

PD: Podías haber preguntado esto en la seccion de español xD.
__________________
Javivi is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 07-23-2011 , 13:04   Re: Help with random_num and players
Reply With Quote #2

Quote:
Originally Posted by Javivi View Post
PHP Code:
public round_start() { 
     
    new 
modo random_num(012
     
    switch(
modo)  
    { 
        case 
1modo_lottery() 
        case 
2modo_normal() 
    } 

Well, you random num goes from 0 to 12, but in the switch statement you have only 2 cases, so probably your cases are never choosen.


Spanish:
----------
Digo que te fijes que el random_num va de 0 a 12, y que tu has puesto que solo haga algo si sale un 1 o 2, asi que tal vez al hacer el random_num nunca ha salido el 1 o 2...

PD: Podías haber preguntado esto en la seccion de español xD.
Thanks Javivi, i know that but i don't need this

_________________________________________
Spanish: Gracias pero lo de 0, 10 ya me di cuenta xD, lo que necesito es dar X numero a cada uno, estilo loteria xd
Stereo is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-23-2011 , 13:11   Re: Help with random_num and players
Reply With Quote #3

PHP Code:
public round_start()
{
    new 
modo random_num1);
    
    switch( 
modo )
    {
        case 
1modo_lottery();
        case 
2modo_normal();
    }
}

public 
modo_lottery( ) 
{  
    new 
number;

    new 
iPlayersMAX_PLAYERS ], iNum
    
get_playersiPlayersiNum"ach" ); 
     
    for( new 
iiNumi++ )  
    {  
        
number random_num113 );
        
cs_set_user_moneyiPlayers], number 1000 );
    }  

Keep in mind that you'll get errors if you have not defined the function modo_normal() yet.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 01:11.


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