Looking For TeamBalancer [URGENT]
#5

7 teams? I'll try to solve it.
I'm presuming you're changing pTeam in OnPlayerRequestClass and checking it in OnPlayerRequestSpawn
Let's go
pawn Код:
public OnPlayerRequestSpawn(playerid){
  for(new i;i < 7;i++){//loop 7 team
    if(gTeam_Amount[gTeam[i]] < gTeam_Amount[gTeam[playerid]]){// find a team is smaller than player team
      sendfmsg(playerid,COLOR_SYSTEM,"Team %s(%i) has too much ppl, try to select other teams(Team %s(%i) needs the man).", gTeam_name[gTeam[playerid]],gTeam[playerid],gTeam_name[gTeam[i]],gTeam[i]);
      return false;
    }
    sendfmsg(playerid,gTeam_color[gTeam[playerid]],"You join team %s(%d)",gTeam_name[gTeam[playerid]],gTeam[playerid]);
    return true;
}
Bere's the simulation
Код:
0 0 0 0
1 0 0 0
1 0 0 1
1 0 1 1
1 1 1 1
1 1 1 2
2 1 1 2
2 2 1 2
2 2 2 2
.
.
.
The most injustice condition is
Код:
8 8 8 8 8 8 7
Edit:I did something wrong, now fix it
Reply


Messages In This Thread
Looking For TeamBalancer [URGENT] - by Kyle - 01.08.2009, 09:17
Re: Looking For TeamBalancer [URGENT] - by Joe Staff - 01.08.2009, 09:57
Re: Looking For TeamBalancer [URGENT] - by -Sneaky- - 01.08.2009, 10:09
Re: Looking For TeamBalancer [URGENT] - by Kyle - 01.08.2009, 10:32
Re: Looking For TeamBalancer [URGENT] - by yezizhu - 01.08.2009, 12:01
Re: Looking For TeamBalancer [URGENT] - by Burridge - 01.08.2009, 12:05

Forum Jump:


Users browsing this thread: 1 Guest(s)