Team balancer
#1

i got a gm with 2 teams but i need team balancer can some one help me plz pm me
Reply
#2

Simple ask how many members are in which team

like this


if(Map1Voll(0))
{
SetPVarInt(playerid,"TeamMap1",1);
}
else if(Map1Voll(1))
{
SetPVarInt(playerid,"TeamMap1",2);
}
if(Map1Voll(2))
{
SetPVarInt(playerid,"TeamMap1",1);
}
else if(Map1Voll(3))
{
SetPVarInt(playerid,"TeamMap1",2);
}
Reply
#3

PHP код:
new TeamPlayers[ <Amount of teams here> ];
public 
OnPlayerRequestSpawn(playerid)
{
    for(new 
teamsteams < [Team Amount]; teams++)
    {
        if(
teams == gTeam[playerid]) continue;
        if(
TeamPlayers[gTeam[playerid]] > TeamPlayers[teams] + 3)
        {
            
SendClientMessage(playeridCOLOR_RED"You can't join this team as it would unbalance the game!");
            return 
0;
        }
    }   

This is how it should be, something like this.
PHP код:
public OnPlayerRequestSpawnplayerid )
{
    for( new 
teamsteams 23teams++ )
    {
        if( 
teams == gTeamplayerid ] ) continue;
        if( 
TeamPlayersgTeamplayerid ] ] > TeamPlayersteams ] + 3)
        {
            
SendClientMessageplayeridCOLOR_RED"You can't join this team as it would unbalance the game!" );
            return 
0;
        }
    }
    return 
1;

Reply
#4

tnx guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)