Team balancing? - 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: Team balancing? (
/showthread.php?tid=126272)
Team balancing? -
bajskorv123 - 07.02.2010
Hey, I have 2 minigames on my server, Counter Strike and Protect The President. (I made both myself from scratch)
I'm using gTeam on both of them.
Uh i need team balancing for both...
I really need it because one time when i tryed them both, on CS it was 6 Counter Terrorists vs 2 Terrorists and on PTP it was 1 protector and 1 president vs 5 Terrorists...
Please i really need a team balancing system, that works.
Thanks
EDIT: Omg why the fuck its an advert here O_O, i didnt put it there so, who did it? I kill you (*Achmed voice)
|
|
\/
Re: Team balancing? -
Calgon - 07.02.2010
It's default...
And you can just use a for / foreach loop, really not that hard if you can create a GM.
Re: Team balancing? -
bajskorv123 - 07.02.2010
Please help me with this
I don't know exactly what you mean
I know the for loop but not how to use it for team balancing
Re: Team balancing? -
Calgon - 08.02.2010
Team Count variable.
pawn Код:
new TeamCount[ 10 ]; // Change the number, to the amount of teams you have.
pawn Код:
public OnPlayerSpawn(playerid)
{
TeamCount[ GetPlayerTeam( playerid ) ] ++;
}
Something like that, then you can use SetPlayerTeam().
Re: Team balancing? -
bajskorv123 - 08.02.2010
Quote:
Originally Posted by CalgonX
Team Count variable.
pawn Код:
new TeamCount[ 10 ]; // Change the number, to the amount of teams you have.
pawn Код:
public OnPlayerSpawn(playerid) { TeamCount[ GetPlayerTeam( playerid ) ] ++; }
Something like that, then you can use SetPlayerTeam().
|
I've added evrything, exept SetPlayerTeam(), how to use it for team balancing?
Im new with the Team functions I've only used gTeam...
Re: Team balancing? -
bajskorv123 - 09.02.2010
Bump...
Re: Team balancing? -
Marcel - 09.02.2010
Check if the amount of players in team 1 is bigger than in team 2, if so, put him in team 2, otherwise, if team 2 is bigger than team 1, put him in team 2. If both statements are false, let them choose theirselves or get a random team.