[Help] How to Max Players in a team. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] How to Max Players in a team. (
/showthread.php?tid=87940)
[Help] How to Max Players in a team. -
RyDeR` - 23.07.2009
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
Re: [Help] How to Max Players in a team. -
Geekzor - 23.07.2009
joining the question
Re: [Help] How to Max Players in a team. -
Westie - 23.07.2009
Learn to count.
Re: [Help] How to Max Players in a team. -
Zothuron - 10.08.2009
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.