28.01.2019, 06:51
You can check if a team is uneven using this operator %
If(GetPlayerCount(teamid) % 2 != 0 )
This way you can solve this problem.
You need some function to get the amount of players inside of a team. Like that
If(GetPlayerCount(teamid) % 2 != 0 )
This way you can solve this problem.
You need some function to get the amount of players inside of a team. Like that
Код:
stock GetTeamPlayerCount(teamid) { new playercount = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(!PlayerInfo[i][pSpawned]) continue; if(!gPlayerHasTeamSelected[i]) continue; if(GetPlayerState(i) == PLAYER_STATE_NONE) continue; if(gPlayerTeamSelection[i] != teamid) continue; playercount++; } return playercount; }