30.12.2010, 12:18
I've got this:
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.
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;
}
}