Eh? How?
#1

Look I was trying to make a server with 3 teams.Ok, team 1 only one guy has to take it. And if a guy from team 3 dies, a guy from team 1 goes on his place. But if there is no body at team 1, how do I know ? Which one wold work ?
pawn Код:
if(team[playerid] == 3)
    {
        new count = 0;
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && team[i] == 1)
            {
                count = 1;
            }
            if(count == 0)
            {
                SendClientMessageToAll(red, "There is nobody at team 1");
            }
            if(count == 1)
            {
                if(IsPlayerConnected(i) && team[i] == 1)
                {
                    team[i] = 3;
                    OnPlayerSpawn(i);
                }
            }
        }
    }
OR
pawn Код:
if(team[playerid] == 3)
    {
        new count;
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(team[i] != 1)
                {
                    count = 0;
                }
                else count++;
               
                if(count == 0)
                {
                    SendClientMessageToAll(red, "There is nobody at team 1");
                }
                if(count == 1)
                {
                    if(IsPlayerConnected(i) && team[i] == 1)
                    {
                        team[i] = 3;
                        OnPlayerSpawn(i);
                    }
                }
            }
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)