Assigning two zombies
#3

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.

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 == id2id Iter_Random(Player);
           if(
id2 == idid2 Iter_Random(Player);
           
           
// Then codes to set id and id2 to zombie.
    
}
    return 
1;

Did i do it right?
Reply


Messages In This Thread
Assigning two zombies - by JaKe Elite - 22.10.2015, 13:16
Re: Assigning two zombies - by Crystallize - 22.10.2015, 18:31
Re: Assigning two zombies - by JaKe Elite - 23.10.2015, 10:52

Forum Jump:


Users browsing this thread: 1 Guest(s)