Team balancer
#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


Messages In This Thread
Team balancer - by mini_mi - 13.09.2012, 13:26
AW: Team balancer - by BiosMarcel - 13.09.2012, 13:30
Re: Team balancer - by Squirrel - 13.09.2012, 17:49
Re: Team balancer - by mini_mi - 14.09.2012, 00:13

Forum Jump:


Users browsing this thread: 3 Guest(s)