Would this work?
#6

Quote:
Originally Posted by iggy1
Посмотреть сообщение
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(JAPCount == USACount)
    {
        new randteam = random(2);//this is assumming the team ids are 0 and 1
        switch(randteam)
        {
            case TEAM_JAPFLEET:
            {
                JAPCount++;
                return 1;
            }
            case TEAM_AIRFORCE:
            {
                USACount++;
                return 1;
            }
        }
    }
    if (LoggedIn[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: You must log in before playing !");
    if (PlayerTeam[playerid] == TEAM_JAPFLEET)
    {
        if (JAPCount > USACount) return SendClientMessage(playerid,COLOR_RED,"INFO: This team is full. Join another team");
        JAPCount++;
    }
    if (PlayerTeam[playerid] == TEAM_AIRFORCE)
    {
        if (USACount > JAPCount) return SendClientMessage(playerid,COLOR_RED,"INFO: This team is full. Join another team");
        USACount++;
    }
}
There might be better ways but thats what i'd do.
Will that just add one to USACount or JAPCount as debug or assign a random team to the player? Because I don't see it assigns a team spawn player or anything like that.

@Mademan: iggy1 said it will be bugged if there are equal count for both teams
Reply


Messages In This Thread
Would this work? - by admantis - 27.12.2010, 19:19
Re: Would this work? - by iggy1 - 27.12.2010, 19:23
Re: Would this work? - by admantis - 27.12.2010, 19:25
Re: Would this work? - by iggy1 - 27.12.2010, 19:30
Re: Would this work? - by MadeMan - 27.12.2010, 19:31
Re: Would this work? - by admantis - 27.12.2010, 19:32
Re: Would this work? - by iggy1 - 27.12.2010, 19:32
Re: Would this work? - by MadeMan - 27.12.2010, 19:33

Forum Jump:


Users browsing this thread: 3 Guest(s)