08.02.2017, 18:25
Not nessacarily like that, you could do something like this:
Alternatively, you could just do this with foreach if you want more optimization:
pawn Код:
new RandomPlayer = INVALID_PLAYER_ID, TempIndex;
while(RandomPlayer == INVALID_PLAYER_ID)
{
TempIndex = random(GetPlayerPoolSize() + 1);
if(TempIndex != INVALID_PLAYER_ID)
RandomPlayer = TempIndex;
}
ApplyAnimation(RandomPlayer, "WUZI", "CS_Dead_Guy", 4.1, 1, 0, 0, 0, 1, 1);
pawn Код:
ApplyAnimation(Iter_Random(Player), "WUZI", "CS_Dead_Guy", 4.1, 1, 0, 0, 0, 1, 1);