Team Balancer
#1

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?
Reply
#2

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;
}
Reply
#3

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?
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)