Raised This Month: $ Target: $400
 0% 

checking for last player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-24-2009 , 09:11   Re: checking for last player
Reply With Quote #7

This will check if only one player is remaining and if so give him m249. You can add a hook to DeathMsg or Ham_Killed and call GiveM249() from within. (untested)
PHP Code:
public GiveM249()
{
    new 
iT iCT ;
    
    
GetLastPlayeriT iCT );
    
    if ( ( 
iT ) && ( iCT == -) )
        
give_itemiT "weapon_m249");
    else if ( ( 
iCT ) && ( iT == -) )
        
give_itemiCT "weapon_m249");
}

public 
GetLastPlayer( &iTerrorist , &iCT )
{
    new 
iPlayers32 ] , iNum iPlayer;
    
    
iTerrorist = -1;
    
iCT = -1;

    
get_playersiPlayers iNum );

    for ( new 
iNum i++ )
    {
        
iPlayer iPlayers];
        
        if ( 
is_user_aliveiPlayer ) )
        {
            switch ( 
get_user_teamiPlayer ) )
            {
                case 
1iTerrorist = ( iTerrorist == -) ? iPlayer 0;
                case 
2iCT = ( iCT == -) ? iPlayer 0;
            }
        }
    }

__________________

Last edited by Bugsy; 12-24-2009 at 09:18.
Bugsy 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:15.


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