1. You can use get_playersnum() without all that extra nonsense.
Code:
new iPlayerCount = get_playersnum( );
// or
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum ); // iNum = connected players
2. Check the player team, then change the variable accordingly.
Code:
switch( get_user_team( iPlayer ) )
{
case 0:
{
// unassigned
}
case 1:
{
// terrorist
}
case 2:
{
// counter-terrorist
}
case 3:
{
// spectator
}
}
// or
switch( cs_get_user_team( iPlayer ) )
{
case CS_TEAM_UNASSIGNED:
{
// unassigned
}
case CS_TEAM_T:
{
// terrorist
}
case CS_TEAM_CT:
{
// counter-terrorist
}
case CS_TEAM_SPECTATOR:
{
// spectator
}
}
__________________