Try using 2.0 instead of 2. And also is it possible that you aren't setting your t and ct variables right?
Code:
new t_count, ct_count, Players[32],pnum;
get_players( Players, pnum , "a" ); //only alive players
for( new i =0; i < pnum; i++ )
{
switch( get_user_team( Players[i] ) )
{
case 1: {t_count++;}
case 2: {ct_count++;}
}
}