01.08.2009, 12:01
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
Bere's the simulation
The most injustice condition is
Edit:I did something wrong, now fix 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;
}
Код:
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 . . .
Код:
8 8 8 8 8 8 7

