Results 1 to 10 of 20

Thread: Revival of the few zombie during the reboot.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Aug 2012
    Posts
    78
    Thanks
    20
    Thanked 10 Times in 5 Posts
    Quote Originally Posted by kung foo man View Post
    Because you need to know which hunters died last (so you can make them zombies).
    I have no idea how to do it, could you help me write it? I do not demand from you a finished script, but directing in the right direction.

  2. #2
    Private
    Join Date
    Aug 2012
    Posts
    78
    Thanks
    20
    Thanked 10 Times in 5 Posts
    He sat a little with the script at night and I wrote something like this:

    PHP Code:
    checkRestart(zombie,axisPlayer)
    {
        
    numonteam["allies"] = 0;
        
    numonteam["axis"] = 0;
        
        
    players getentarray("player""classname");
        for(
    0players.sizei++)
        {
            
    player players[i];

            if(!
    isDefined(player.pers["team"]) || player.pers["team"] == "spectator" || (isPlayer(self) && self.sessionstate == "playing") && (isPlayer(self) && self.pers["team"] == "spectator"))
                continue;
            
            
    numonteam[player.pers["team"]]++;
        }
        
        if ((
    numonteam["allies"] == 0) && (numonteam["axis"] > 1))
        {
            if(
    isDefined(zombie) && isPlayer(zombie))
            {
                
    0;
                if (
    players.size%== 0)
                {
                    
    int((players.size/2)-1);
                    
    iprintlnbold("Wynik = "+j);
                } 
                else
                {
                    
    int((players.size/2));
                    
    iprintlnbold("Wynik2 = "+j);
                }
                
                for(
    i=jii--)
                {
                    
    //axisPlayer = zombie;
                    
    axisPlayer players[randomint(players.size)];
                    
    //iprintlnbold("Last Death Allies: "+self.lastDeath);
                    //iprintlnbold("Wynik3 = "+randomint(players.size));
                
    }
            }
            else
            {
                
    axisPlayer players[randomint(players.size)];
            }
            
            for(
    0players.sizei++)
            {
                
    player players[i];
                
                if(!
    isDefined(player.pers["team"]) || player.pers["team"] == "spectator")
                    continue;
                
                
    player thread showText(&"ZOM_ROUND_RESTART");
                
                if (
    player == axisPlayer)
                {
                    
    player thread movePlayer("axis"2);
                }
                else
                {
                    
    player thread movePlayer("allies"4);
                }
            }
            return 
    true;
        }
        else
        {
            return 
    false;
        }

    In Callback_PlayerKilled i add:

    if (self.pers["team"] == "allies") self.lastDeath = getTime();

    But i don't know how use self.lastDeath...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •