Well, when looping through the players, make sure to do
PHP Code:
new players[32], pnum
get_players(players, pnum)
for(new i; i < pnum; i++)
{
new tempid = players[i]
}
The way you are doing it, it will loop through 33 times instead of just 32 as well.
Also, when doing this:
PHP Code:
if((team1 > team2) && (team1 > team2+1))
{
//team1 has too many people, do something about it.
}
There is no need for the first check because if the second one is true, the first one has to be true.