How to start a team balancer - 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: How to start a team balancer (
/showthread.php?tid=198751)
How to start a team balancer -
Kitten - 13.12.2010
Solved
Re: How to start a team balancer -
The_Gangstas - 13.12.2010
foreach player
if(selected classid is gTeam[playerid] == Zombie)
zcount++;
foreach player
if(selected classid is gTeam[playerid] == Humans)
hcount++;
if selected team_humans - if(hcount >= zcount) gTeam[playerid] = Zombie;
Re: How to start a team balancer -
admantis - 13.12.2010
Quote:
Originally Posted by The_Gangstas
foreach player
if(selected classid is gTeam[playerid] == Zombie)
zcount++;
foreach player
if(selected classid is gTeam[playerid] == Humans)
hcount++;
if selected team_humans - if(hcount >= zcount) gTeam[playerid] = Zombie;
|
this is a really helpful theory.
Re: How to start a team balancer -
Kwarde - 13.12.2010
pawn Код:
if(gTeam[playerid] == Zombie)
zcount++;
else if(gTeam[playerid] == Human)
hcount++
if(gTeam[playerid] == Human)
if(hcount >= zcount)
gTeam[playerid] = Zombie;
If you use the theory above, it should looks like this a bit