I know this is very awful code for team balancing but what do you think? Will this work?
PHP Code:
new t_count, ct_count, num, players[32], tempid;
new ct_count = get_players( players, num, "ae", "CT" ); //Get ct count
new t_count = get_players( players, num, "ae", "T" ); //Get t count
if(t_count > ct_count){
// T - CT
new tcount = t_count - ct_count;
if(tcount > 1){
//If there are more than 1 player which makes team unequal.
// There are more Ts.then allowed!
while(tcount>1){
new t_count = get_players( players, num, "ae", "T" );
for(new i = 0; i<tcount; i++){
tempid = players[i];
cs_set_user_team(tempid, CS_TEAM_CT); //Change Player's team...
i++;
}
tcount++;
}
}
}
-TY!