get_players can return false results with dead players and flags "e", so considering you gonna execute this at round end, it would be better to prevent those false results.
PHP Code:
public round_end()
{
new iTerroristsNum, iCtsNum
CountTeams(iTerroristsNum, iCtsNum)
}
CountTeams(&TERRORISTS, &CTS)
{
TERORISTS = 0
CTS = 0
new iPlayers[32], iNum
get_players(iPlayers, iNum, "h")
if( !iNum )
{
return
}
for(--iNum; iNum<=0; iNum--)
{
switch( cs_get_user_team(iPlayers[iNum]) )
{
case CS_TEAM_T:++TERRORISTS
case CS_TEAM_CT:++CTS
}
}
}
__________________