Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Updated pause script for BO2 zm

Updated pause script for BO2 zm

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
3 Posts 3 Posters 159 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • NoahOWundefined Offline
    NoahOWundefined Offline
    NoahOW
    wrote last edited by NoahOW
    #1

    pause_system.gsc

    #include scripts\zm\pause_system;
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes_zm\_hud_util;
    #include maps\mp\zombies\_zm_utility;
    
    watchchatpause()
    {
        level endon("end_game");
        self endon("disconnect");
        
        for(;;)
        {
            level waittill("say", message, player);
            message = toLower(message);
    
            if (message == "p" && player == self)
            {
                self freezeControls(true);
                self.ignoreme = 1;
                
                zombies = getAiSpeciesArray("axis", "all"); 
                if (isDefined(zombies))
                {
                    foreach(zombie in zombies)
                    {
                        if (isDefined(zombie) && isAlive(zombie))
                        {
                            // Create an invisible anchor point at the zombie's feet
                            zombie.pauser_anchor = spawn("script_origin", zombie.origin);
                            zombie.pauser_anchor.angles = zombie.angles;
                            
                            // Physically link the zombie to the stationary point
                            zombie linkto(zombie.pauser_anchor);
                            
                            // Disable their attack/AI processing
                            zombie.ignoreall = 1; 
                            if(isDefined(zombie.zombie_move_speed))
                            {
                                zombie.old_speed = zombie.zombie_move_speed;
                                zombie.zombie_move_speed = "stop";
                            }
                        }
                    }
                }
    
                // HUD
                if(isDefined(level.pause_hud)) level.pause_hud destroy();
                level.pause_hud = createServerFontString("default", 2.0);
                level.pause_hud setPoint("CENTER", "CENTER", 0, 0);
                level.pause_hud setText("GAME PAUSED: Type 'u' to resume");
    
                while(1)
                {
                    level waittill("say", m, p);
                    if(toLower(m) == "u" && p == self) break;
                    wait 0.1;
                }
    
                // --- Unfreeze ---
                zombies = getAiSpeciesArray("axis", "all");
                foreach(zombie in zombies)
                {
                    if (isDefined(zombie) && isAlive(zombie))
                    {
                        zombie unlink();
                        if(isDefined(zombie.pauser_anchor))
                            zombie.pauser_anchor delete();
                        
                        zombie.ignoreall = 0;
                        if(isDefined(zombie.old_speed))
                            zombie.zombie_move_speed = zombie.old_speed;
                    }
                }
    
                if(isDefined(level.pause_hud)) level.pause_hud destroy();
                self freezeControls(false);
                self.ignoreme = 0;
            }
            wait 0.1;
        }
    }
    

    zm_mod.gsc

    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes_zm\_hud_util;
    #include maps\mp\zombies\_zm_utility;
    
    init()
    {
        level thread onPlayerConnect();
    }
    
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill("connected", player);
            player thread onPlayerSpawned();
        }
    }
    
    onPlayerSpawned()
    {
        self endon("disconnect");
        for(;;)
        {
            self waittill("spawned_player");
            self thread watchchatpause(); // This starts your script!
        }
    }
    

    you must include both into \AppData\Local\Plutonium\storage\t6\raw\scripts\zm
    enjoy 🙂
    all you have to do is type p in chat and it pauses the game and to unpause type u.
    source gemini

    1 Reply Last reply
    0
    • FaZe Flickundefined Offline
      FaZe Flickundefined Offline
      FaZe Flick
      wrote last edited by
      #2

      is this for co-op?

      DanDjarinundefined 1 Reply Last reply
      0
      • FaZe Flickundefined FaZe Flick

        is this for co-op?

        DanDjarinundefined Offline
        DanDjarinundefined Offline
        DanDjarin
        wrote last edited by
        #3

        FaZe Flick yes

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Unread 0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups