SA-MP Forums Archive
Auto Team Balance - 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)
+--- Thread: Auto Team Balance (/showthread.php?tid=351507)



Auto Team Balance - sanrock - 16.06.2012

How do I make an auto team balance so like if there

1 zombie but 5+ humans one person will become a zombie with the other person?

And if 0 humans, 2+ zombies one person will become a human?


Re: Auto Team Balance - leonardo1434 - 16.06.2012

It's only an exemple...

pawn Код:
// make a settimer.
if(humans >= 5 || zombies <=2))
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
       i = zombies;
       random(100) + SetPlayerTeam(playerid,zombie);
       SpawnPlayer(playerid);
       if(i >= 3) break;
  }
 
}



Re: Auto Team Balance - sanrock - 18.06.2012

How do I make it for

TEAM_ZOMBIE
and
TEAM_HUMAN?


Re: Auto Team Balance - sanrock - 18.06.2012

(100 Viewing) viewing this section

None helps me!


Re: Auto Team Balance - tiernantheman - 19.06.2012

pawn Код:
new TeamPlayers[ <Amount of teams here> ];

public OnPlayerRequestSpawn( playerid )
{
    for( new teams; teams < 23; teams++ )
    {
        if( teams == gTeam[ playerid ] ) continue;
        if( TeamPlayers[ gTeam[ playerid ] ] > TeamPlayers[ teams ] + 3)
        {
            SendClientMessage( playerid, COLOR_RED, "You can't join this team as it would unbalance the game!" );
            return 0;
        }
    }
    return 1;
}



Re: Auto Team Balance - sanrock - 19.06.2012

No I want like a team switcher so if like

1 zombie but 5+ humans one person will become a zombie with the other person?

And if 0 humans, 2+ zombies one person will become a human?


Re: Auto Team Balance - tiernantheman - 19.06.2012

Quote:
Originally Posted by sanrock
Посмотреть сообщение
No I want like a team switcher so if like

1 zombie but 5+ humans one person will become a zombie with the other person?

And if 0 humans, 2+ zombies one person will become a human?
What I posted will get you there. Try learning it. Besides there are plenty of threads like this use the search function and type Team Balancer or something similar.


Re: Auto Team Balance - sanrock - 19.06.2012

You posted a fulll team script not an switch team script!


Re: Auto Team Balance - iggy1 - 19.06.2012

Why don't you try to script it yourself? And then if it's bugged post here for help. You are requesting a script and that doesn't belong here.