23.10.2015, 10:52
I am not so sure the above code would work so i tried out making my own version using the Iter_Random from foreach, doe i am not sure if i coded it properly, or if it works.
Did i do it right?
PHP код:
forward AssignZombie();
public AssignZombie()
{
if(survivors <= 2)
{
EndGame();
SendClientMessageToAll(COLOR_RED, "Not enough players, Server might cause some issues on assigning the zombies.");
SendClientMessageToAll(-1, "Next game is loaded instead...");
print("AssignZombie(): Due to lack of players, We will skip this game.");
print("Reason Sended out: Server might cause some issues on assigning the zombies.");
print("The game has been skipped and the next game will be played instead.");
}
else
{
survivor_time = false;
new id = Iter_Random(Player);
new id2 = Iter_Random(Player);
if(id == id2) id = Iter_Random(Player);
if(id2 == id) id2 = Iter_Random(Player);
// Then codes to set id and id2 to zombie.
}
return 1;
}