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=187382)



Team Balancer - Saurik - 02.11.2010

I fail at making team balancers.. sometimes when the team is empty players are not allowed to join it =[

and i did search and didnt find anything useful

i need a team balancer for 3 teams.


help?


Re: Team Balancer - Mean - 02.11.2010

I don't know how to make that, try to search -.-'
EDIT: Found it


pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new maxteamplayers[10]; // Put how much players you want max in the team
    for(new i, m = GetMaxPlayers(); i < m; i++)
    if(IsPlayerConnected(i))
    maxteamplayers[gTeam[playerid]]++;
    if(maxteamplayers[gTeam[playerid]] > maxteamplayers[!gTeam[playerid]])
    SendClientMessage(playerid, COLOR_BRIGHTRED, "Team full, choose other team to keep the game balanced");
    return 1;
}



Re: Team Balancer - [SFA]SpiRRiT - 06.03.2011

Quote:
Originally Posted by Mean
Посмотреть сообщение
I don't know how to make that, try to search -.-'
EDIT: Found it


pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new maxteamplayers[10]; // Put how much players you want max in the team
    for(new i, m = GetMaxPlayers(); i < m; i++)
    if(IsPlayerConnected(i))
    maxteamplayers[gTeam[playerid]]++;
    if(maxteamplayers[gTeam[playerid]] > maxteamplayers[!gTeam[playerid]])
    SendClientMessage(playerid, COLOR_BRIGHTRED, "Team full, choose other team to keep the game balanced");
    return 1;
}
does this work?


Re: Team Balancer - alpha500delta - 06.03.2011

Or you can just do

pawn Код:
new Team = 0;

public OnPlayerRequestSpawn(playerid)
{
    Team++;
    if(Team == 5) return something
    return 1;
}
I guess? I don't know xd