View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-09-2011 , 10:17   Re: how get count of players
Reply With Quote #13

This will count any type of bot, not just podbot.
PHP Code:
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 ( new 
iNum p++ )
    {
        
iPlayer iPlayers]
        
        if ( 
is_user_botiPlayer ) )
            ++
BOTS
        
        
switch( cs_get_user_team(iPlayer) )
        {
            case 
CS_TEAM_T:++TERRORISTS
            
case CS_TEAM_CT:++CTS
        
}
    }

__________________

Last edited by Bugsy; 10-09-2011 at 13:56.
Bugsy is offline