SA-MP Forums Archive
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: Team balancer? (/showthread.php?tid=247117)



Team balancer? - -Rebel Son- - 07.04.2011

Well, Searched for two days, Cant find a working team balancer.
I Got two teams using gTeam.
Can anyone give me an example on how i can do this?

p.s( Just making a Mini mode But i need Balanced teams of 10 a peice )


Re: Team balancer? - marinov - 07.04.2011

make a variable for each team like :

new Team1;
new Team2;

and do like this OnPlayerSpawn

if(gTeam[playerid][Team]
{
Team1 ++;
}

then you work on how you do to players select team like : (Normaly on OnPlayerRequestSpawn)

if(Team1 > Team2)
{
SendClientMessage(playerid, RED, "This team is full, please pick a different one");
Return 0;
}


Re: Team balancer? - -Rebel Son- - 07.04.2011

Thanks for the reply, But i've tryed this. Can you give me another example?


Re: Team balancer? - marinov - 07.04.2011

hummm I can't think of a other way to do it, I will post if something comes to my head


Re: Team balancer? - -Rebel Son- - 07.04.2011

Alright thanks. Really need this, Searched forever still cant find a working Example