[Help] Cant make a 4 team balancer...
#1

I tried my best, but i can only make team balancers for 2 teams and not four!

Help!

The teams are USA, China, Russia, Japan
Reply
#2

Be more specific..

Balancer for what? Number of players on each team or what?
Reply
#3

or show us the code, so we can help you with this
Reply
#4

What are the 4 teams? Also, are you using gTeam or another variable?
Reply
#5

hey, thanks for replies. yes im using gteam.

And my server has 50 slots, soon will have more.

i want it to balance out.

i cant really tell you how many per team, because what if there are 6 players on, 5 on one team and 1 on other
Reply
#6

Simple, put them on the team with the lowest amount of players. If they all have the same, random team.
Reply
#7

i know.. but i cant script it, thats what i posted [obv]
Reply
#8

I got this from a GM, not actually what you want
but could be usefull

pawn Код:
for(new p = 0; p < GetMaxPlayers(); p++)
  {
    if (GetPlayerTeam(p) == TEAM_ArmyRUS) Count1++;
    else if (GetPlayerTeam(p) == TEAM_ArmyUSA) Count2++;
  }
  if ((Count1 > Count2) && GetPlayerTeam(playerid) == TEAM_ArmyUSA)
  {
    SendClientMessage(playerid,COLOR_RED, "[SERVER] Please choose another team so match will be balanced.");
    return 0;
  }
  else if ((Count2 > Count1) && GetPlayerTeam(playerid) == TEAM_ArmyRUS)
  {
    SendClientMessage(playerid,COLOR_RED, "[SERVER] Please choose another team so match will be balanced.");
    return 0;
  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)