Team choise
#1

Forum people, I have a question, how can I make a maximum for teams? for example when the team red and blue are uneven, 2 in red and in blue 1. How can i make a player by choosing red (that has 2) you deny the function and tell him that the team is full that he chooses another ?
Reply
#2

You can check if a team is uneven using this operator %
If(GetPlayerCount(teamid) % 2 != 0 )
This way you can solve this problem.


You need some function to get the amount of players inside of a team. Like that
Код:
stock GetTeamPlayerCount(teamid) { new playercount = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(!PlayerInfo[i][pSpawned]) continue; if(!gPlayerHasTeamSelected[i]) continue; if(GetPlayerState(i) == PLAYER_STATE_NONE) continue; if(gPlayerTeamSelection[i] != teamid) continue; playercount++; } return playercount; }
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
y_groups has a balance function for exactly this.
hello and_less I appreciate your help, but i do not know the use of your include can you help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)