Raised This Month: $ Target: $400
 0% 

stop the count when reached the number


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 12-22-2009 , 02:56   stop the count when reached the number
Reply With Quote #1

hi guys, i have this ....

PHP Code:
public forward_killid )
{
    if( 
bKillid ] > MAX_KILLS )
    {
        
bKillid ] = MAX_KILLS;
        return 
FMRES_IGNORED;
    }

    if( 
bKillid ] == MAX_KILLS )
    {
        
get_user_nameidszNamecharsmaxszName ) );
        
        
color_print0"^3%s^1 has reached the number %d!"nameMAX_KILLS );
       
bKillid ] = MAX_KILLS;
    }

    
bKillid ] += 1;

    return 
FMRES_IGNORED;

well i want the bKill[ id ] stops permanently when has reachedthe max kills number... because if i reach the maxkills number says in chat, but the count doesnt stop.
help
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 12-22-2009 , 04:29   Re: stop the count when reached the number
Reply With Quote #2

Something like this ?
Code:
public forward_kill( id ) {     if( bKill[ id ] >= MAX_KILLS )     {     //  bKill[ id ] = MAX_KILLS;         return FMRES_IGNORED;     }         if( ++bKill[ id ] == MAX_KILLS )     {         get_user_name( id, szName, charsmax( szName ) );                 color_print( 0, "^3%s^1 has reached the number %d!", name, MAX_KILLS );         bKill[ id ] = MAX_KILLS;     }         return FMRES_IGNORED; }
__________________
xPaw is offline
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
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 12-22-2009 , 05:18   Re: stop the count when reached the number
Reply With Quote #4

thank you both ... works fine -.-
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
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 04:02.


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