10.11.2010, 00:15
Create Some global variables like this:
Everytime someone joins a team add that + 1, everytime someone leaves minus by 1
So if someone joins the UC team do
When they leave UC team do
Then when joining the team do comparisons to all the other teams.
For example say UCPlayers has 3 players online and humans have 2
if player trys to join UCPlayers do:
if(UCPlayers > HumansPlayers)
{
Send a message saying you cannot join this team because it's too big.
}
And to do a balance eg. many people on one team leave. Have a check that runs every once in a while like every 30 seconds or 60 seconds.
pawn Код:
new HumansPlayers;
new ZombiesPlayers;
new ScientistPlayers;
new DoctorPlayers;
new HumansPlayers;
new StarsPlayers;
new UCPlayers;
So if someone joins the UC team do
pawn Код:
UCPlayers++;
pawn Код:
UCPlayers--;
Then when joining the team do comparisons to all the other teams.
For example say UCPlayers has 3 players online and humans have 2
if player trys to join UCPlayers do:
if(UCPlayers > HumansPlayers)
{
Send a message saying you cannot join this team because it's too big.
}
And to do a balance eg. many people on one team leave. Have a check that runs every once in a while like every 30 seconds or 60 seconds.