Help me with Team Balancer
Someone help me make a team balancer? i tried, it gave no errors but it still doesnt work, ,, lets to many players on one team

i have 5 teams,,, help please
Take off of this example:

playerid - the player
team_1 - the team that is being calculated by the ratio
team_2 - the other team
ratio - the ratio of which to balance team 1 from team 2
teamvar - the variable to hold the player's team

EXAMPLE:
pawn Код:
`OnPlayerSpawn(playerid){  TeamBalance(playerid, TEAM_GREEN, TEAM_BLUE, 1, Team); // Sets the balance of the teams equal}`
pawn Код:
`TeamBalance(playerid, team_1, team_2, ratio, teamvar[]) {  new result_var = (Players() / ratio);  for(new x = 0; x < MAX_PLAYERS; x++) {   if(teamvar[x] == team_1) {     count++;   }  }  if(count < result_var) {   teamvar[playerid] = team_1;  } else {   teamvar[playerid] = team_2;  }}`
on my server i have something like this

Код:
```if(TeamPlayers[gTeam[playerid]-1] > Players /5 +1)
{
GameTextForPlayer(playerid, "~g~THIS TEAM IS ~r~FULL~w~, choose ~b~another~w~!", 1500, 3);
return 0;
}
return 1;
}```

Forum Jump:

Users browsing this thread: 1 Guest(s)