[Help] How to Max Players in a team.
#1

Hello, I want to do Max Players in a team, Like in mini-missions by MID, (The team is full please chose an other team like this) How to do that? I have really no idea how to do that? :S
Reply
#2

joining the question
Reply
#3

Learn to count.
Reply
#4

I would proberly do something like this at top
Код:
new EvilTeamCount;
new GoodTeamCount;
And OnPlayerRequestSpawn:
Код:
//===========If good team is chosen (team 1)==============

if (EvilTeamCount > GoodTeamCount) {
SendClientMessage(playerid, COLOR, "Team is full");
return 0;
} else { 
return 1;
}

//===========If Evil team is chosen (team 2)==============

if (GoodTeamCount > EvilTeamCount) {
SendClientMessage(playerid, COLOR, "Team is full");
return 0;
} else { 
return 1;
}
And then if team isnt full OnPlayerSpawn

Код:
//===== Good Team =====
GoodTeamCount++;

//===== Evil Team =====
EvilTeamCount++;
Then OnPlayerDeath & OnPlayerDisconnect i would put
Код:
//===== Good Team =====
GoodTeamCount--;

//===== Evil Team =====
EvilTeamCount--;
So thats how i would do it, you'd have to sort it out though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)