Spectating a random team player
#1

I've got this:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(hasDied[playerid]) {
        new rand = random(playersAliveCount);
        if(gTeam[rand] == gTeam[playerid]) {
            TogglePlayerSpectating(playerid, 1);
            PlayerSpectatePlayer(playerid, rand);
        } else {

        }
        return 0;
    }
}
But I want to make it so that if the random player's team is not the same as the local player's team, it will generate a new random player id and check again.
Reply


Messages In This Thread
Spectating a random team player - by jameskmonger - 30.12.2010, 12:18
Re: Spectating a random team player - by MadeMan - 30.12.2010, 12:59
Re: Spectating a random team player - by jameskmonger - 30.12.2010, 18:05
Re: Spectating a random team player - by MadeMan - 30.12.2010, 18:09
Re: Spectating a random team player - by jameskmonger - 30.12.2010, 18:24
Re: Spectating a random team player - by MadeMan - 30.12.2010, 18:29
Re: Spectating a random team player - by jameskmonger - 30.12.2010, 18:50
Re: Spectating a random team player - by jameskmonger - 30.12.2010, 18:51
Re: Spectating a random team player - by jameskmonger - 31.12.2010, 08:32

Forum Jump:


Users browsing this thread: 3 Guest(s)