Help ASAP [+rep]
#2

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new team1count, team2count;
    for(new i, m = GetMaxPlayers(); i < m; i++)
    {
        if (IsPlayerConnected(i))
        {
            if (gTeam[i] == TEAM_ONE) team1count++;
            else if (gTeam[i] == TEAM_TWO) team2count++;
        }
    }
    if (gTeam[playerid] == TEAM_ONE)
    {
        if (team1count > (team2count+1)){
        SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
            return 0;
        }

    }
    else if (gTeam[playerid] == TEAM_TWO)
    {
        if ((team1count+1) < team2count){
        SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
            return 0;
        }
    }
    return 1;
}
Good Luck with it!
Change the gTeams.
Reply


Messages In This Thread
Help ASAP [+rep] - by lordturhan - 26.01.2012, 17:38
Re: Help ASAP [+rep] - by geerdinho8 - 26.01.2012, 17:43
Re: Help ASAP [+rep] - by lordturhan - 26.01.2012, 17:52
Re: Help ASAP [+rep] - by lordturhan - 26.01.2012, 18:44
Re: Help ASAP [+rep] - by geerdinho8 - 26.01.2012, 19:07
Re: Help ASAP [+rep] - by [ABK]Antonio - 26.01.2012, 19:18

Forum Jump:


Users browsing this thread: 1 Guest(s)