Raised This Month: $ Target: $400
 0% 

stop the count when reached the number


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 12-22-2009 , 04:31   Re: stop the count when reached the number
Reply With Quote #3

You want that when he reaches the max value it displays the max value on every kill? If so:

PHP Code:
public forward_killid )
{    
    if( 
bKillid ] == MAX_KILLS )
    {
        
get_user_nameidszNamecharsmaxszName ) );
        
        
color_print0"^3%s^1 has reached the number %d!"nameMAX_KILLS );      
    }
    else if( 
bKillid ] < MAX_KILLS )
    {
        
bKillid ]++;
    }

If you don't want it to display
PHP Code:
public forward_killid )
{    
    if( 
bKillid ] == MAX_KILLS )
    {
        
get_user_nameidszNamecharsmaxszName ) );
        
        
color_print0"^3%s^1 has reached the number %d!"nameMAX_KILLS );   
    }
    
    if( 
bKillid ] <= MAX_KILLS )
    {
        
bKillid ]++;
    }

And if you want to use bKill[ id ] in another place having its MAX_VALUE at MAX_KILLS but you don't want the message to appear in every kill saying that you have the MAX_VALUE you must use it like

PHP Code:
bKillid ] > MAX_KILLS MAX_KILLS bKillid 
because if you do

PHP Code:
bKillid ] = MAX_KILLS 
the message will appear again in the next kill

Edit:

Nevermind the last part of what I said. Do this:

PHP Code:
public forward_killid )
{       
    if( 
bKillid ] < MAX_KILLS )
    {
        if( ++
bKillid ] == MAX_KILLS )
        {
            
get_user_nameidszNamecharsmaxszName ) );        
            
color_print0"^3%s^1 has reached the number %d!"nameMAX_KILLS );  
        }
    }


Last edited by joaquimandrade; 12-22-2009 at 04:36.
joaquimandrade is offline
 



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 04:02.


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