Raised This Month: $ Target: $400
 0% 

Get Lower Player Num


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-14-2010 , 17:02   Re: Get Lower Player Num
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>

new PLUGIN[]  = "Teamchanger"
new AUTHOR[]  = "Schwabba"
new VERSION[] = "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
set_task(5.0,"CTcheck",0,_,_,"b")
}
public 
CTcheck( )
{
    new 
iPlayers[32],iNumCts
    get_players
(iPlayersiNum)
    for(new 
i=0;i<iNum;i++)
    {
        new 
plr iPlayers[i]
        if(
cs_get_user_team(plr) == CS_TEAM_CT)
        {
            
Cts++
            if (
Cts 5)
            {
                new 
snick[32];
                
get_user_name(plrsnick31);
                
cs_set_user_team(plrCS_TEAM_T)
                
client_print(0print_chat"There are already 5 Ct's, %s got switched to the T's"snick);
                
// Remove '//' on the line below to slay the switched player.
                // set_user_health(plr, 0)
            
}
        }
    }

If there are more than 5 CT's, the 5 CT's with the higher playtime stay CT, all other get switched to T's.

Last edited by Schwabba; 10-14-2010 at 17:06.
Schwabba 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 10:20.


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