View Single Post
ROKronoS
Senior Member
Join Date: Oct 2010
Location: Bucharest, Romania
Old 10-09-2011 , 13:47   Re: how get count of players
Reply With Quote #17

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("round_end"2"1=Round_End");
    
// Add your code here...
}

public 
round_end()
{
new 
iT iCT iBots;
CountTeamsiT iCT iBots ); 
}



CountTeams(&TERRORISTS, &CTS, &BOTS)
{
    
TERRORISTS 0
    CTS 
0
    BOTS 
0

    
new iPlayers[32], iNum iPlayer
    get_players
(iPlayersiNum"h")
    
    if( !
iNum )
    {
        return
    }
    
    for(--
iNumiNum<=0iNum--)
    {
        
iPlayer iPlayersiNum ]

        if( 
iPlayer 33 )
        {
                if ( 
is_user_botiPlayer ) )
                    ++
BOTS
        
                
switch( cs_get_user_team(iPlayer) )
                {
                    case 
CS_TEAM_T:++TERRORISTS
                    
case CS_TEAM_CT:++CTS
                
}
                if(
TERRORISTS == 1)
                    
client_print(0print_chat"123")
        }
    }


ROKronoS is offline