[Solved] 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: [Solved] Team Balancer (
/showthread.php?tid=115068)
[Solved] Team Balancer -
RyDeR` - 22.12.2009
Hello, I'm searching the hole day for TEAM BALANCERS I found a lot of different balancers but they all don't work. Maybe someone of you guys have one and want to share it.
Thanks in advance.
I have 2 teams, I use gTeam and the teams are TEAM_POLIS and TEAM_TEROR.
Re: Team Balancer -
[HiC]TheKiller - 22.12.2009
How many teams do you have? I may be able to write something up for you quickly

.
Re: Team Balancer -
jamesb93 - 22.12.2009
I have something like this, This will work if you have 2 teams, Just change it what you need, If you need to add more it's easy:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(Classid[playerid] == 0 || Classid[playerid] == 1 || Classid[playerid] == 2 || Classid[playerid] == 3 || Classid[playerid] == 4)
{
if(TeamGrove > TeamLSPD && GroveTeam[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED, "[SYSTEM] In order to balance the teams, You Must Choose The LSPD");
return 0;
}
return 1;
}
if(Classid[playerid] == 5 || Classid[playerid] == 6 || Classid[playerid] == 7 || Classid[playerid] == 8 || Classid[playerid] == 9 || Classid[playerid] == 10)
{
if(TeamLSPD > TeamGrove && LSPDTeam[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED, "[SYSTEM] In order to balance the teams, You Must Choose The Grove Street");
return 0;
}
return 1;
}
Re: Team Balancer -
RyDeR` - 22.12.2009
Quote:
Originally Posted by [HiC
TheKiller ]
How many teams do you have? I may be able to write something up for you quickly  .
|
Edited: 2 teams.
_________________________________________________
Thanks i'll try it.
Re: Team Balancer -
RyDeR` - 22.12.2009
Sory for spam. Don't work.
Re: [STILL NOT SOLVED] Team Balancer -
jamesb93 - 22.12.2009
How many skins does each team have? and I'll make one
Re: [STILL NOT SOLVED] Team Balancer -
Tigerbeast11 - 22.12.2009
cant u make a variable? for example:
pawn Код:
new lspdplayers[MAX_PLAYERS];
new groveplayers[MAX_PLAYERS];
public OnPlayerRequestSpawn(playerid)
{
if(lspdplayers[playerid] > groveplayers[playerid])
{
SendClientMessage(playerid,COLOR_BLUE,"Please choose the other team to balance the game");
return 0;
Get the idea?
Re: [STILL NOT SOLVED] Team Balancer - [03]Garsino - 22.12.2009
Quote:
Originally Posted by Tigerbeast11
cant u make a variable? for example:
pawn Код:
new lspdplayers[MAX_PLAYERS]; new groveplayers[MAX_PLAYERS];
public OnPlayerRequestSpawn(playerid) { if(lspdplayers[playerid] > groveplayers[playerid]) { SendClientMessage(playerid,COLOR_BLUE,"Please choose the other team to balance the game"); return 0;
Get the idea?
|
then use SetSpawnInfo.
Re: [STILL NOT SOLVED] Team Balancer -
Oxside - 22.12.2009
new lspdplayers[MAX_PLAYERS];
new groveplayers[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(lspdplayers[playerid] > groveplayers[playerid])
{
SendClientMessage(playerid,COLOR_BLUE,"Please choose the other team to balance the game (Reconnect)");
Kick(playerid);
}
return 1;
}
Re: [STILL NOT SOLVED] Team Balancer - [03]Garsino - 22.12.2009
Quote:
Originally Posted by Oxside
new lspdplayers[MAX_PLAYERS];
new groveplayers[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(lspdplayers[playerid] > groveplayers[playerid])
{
SendClientMessage(playerid,COLOR_BLUE,"Please choose the other team to balance the game (Reconnect)");
Kick(playerid);
}
return 1;
}
|
thats a bad script, because people would get pissed, I would rather disable spawn for the player untill he choose the other team!