Quote:
Originally Posted by iggy1
pawn Код:
public OnPlayerRequestSpawn(playerid) { if(JAPCount == USACount) { new randteam = random(2);//this is assumming the team ids are 0 and 1 switch(randteam) { case TEAM_JAPFLEET: { JAPCount++; return 1; } case TEAM_AIRFORCE: { USACount++; return 1; } } } if (LoggedIn[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: You must log in before playing !"); if (PlayerTeam[playerid] == TEAM_JAPFLEET) { if (JAPCount > USACount) return SendClientMessage(playerid,COLOR_RED,"INFO: This team is full. Join another team"); JAPCount++; } if (PlayerTeam[playerid] == TEAM_AIRFORCE) { if (USACount > JAPCount) return SendClientMessage(playerid,COLOR_RED,"INFO: This team is full. Join another team"); USACount++; } }
There might be better ways but thats what i'd do.
|
Will that just add one to USACount or JAPCount as debug or assign a random team to the player? Because I don't see it assigns a team spawn player or anything like that.
@Mademan: iggy1 said it will be bugged if there are equal count for both teams