13.12.2016, 10:05
How do I choose 2 players in Iter_Random?
TwoRandomPlayers(&player1, &player2)
{
if (Iter_Count(Player) > 1)
{
player1 = Iter_Random(Player);
do
{
player2 = Iter_Random(Player);
}
while (player1 == player2);
return 1;
}
return 0;
}
GetRandomPlayer()
{
static Iterator:StaticList<MAX_PLAYERS>;
if (Iter_Size(StaticList) == 0)
{
foreach (new i : Player)
Iter_Add(i);
}
new ret = Iter_Random(StaticList);
Iter_Remove(StaticList, ret);
return ret;
}