Need help! +rep+++
#2

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

    }
    else if (gTeam[playerid] == TEAM_BALA)
    {
        if ((team1count+1) < team2count){
            SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
            return 0;
        }
    }
    return 1;
}
it works perfect for me.. +rep it will work.
Reply


Messages In This Thread
Need help! +rep+++ - by Nirzor - 28.08.2012, 15:17
Re: Need help! +rep+++ - by Jarnu - 28.08.2012, 15:19
Re: Need help! +rep+++ - by Nirzor - 28.08.2012, 15:37

Forum Jump:


Users browsing this thread: 1 Guest(s)