09.04.2010, 12:33
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
i have 5 teams,,, help please
OnPlayerSpawn(playerid)
{
TeamBalance(playerid, TEAM_GREEN, TEAM_BLUE, 1, Team); // Sets the balance of the teams equal
}
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;
}
}
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; }