Instead of trying to avoid unassigned/spectator, just look for what you want which is players on a team. A switch is really only good if you want to react a number of different ways based on a value. Here an if-statement is better since you only want to do something if player is on a team which is easy since T=1 and CT=2.
PHP Code:
new iPlayers[ 32 ] , iNum , iPlayer;
get_players( iPlayers , iNum , "ch" );
for ( new i = 0 ; i < iNum ; i++ )
{
iPlayer = iPlayers[ i ];
if ( CS_TEAM_T <= cs_get_user_team( iPlayer ) <= CS_TEAM_CT )
MainMenu( iPlayer );
}
__________________