Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. A Simple Pause Script for BO2 Zombies

A Simple Pause Script for BO2 Zombies

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
20 Posts 14 Posters 5.0k 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.
  • Killerbroundefined Offline
    Killerbroundefined Offline
    Killerbro
    wrote on last edited by
    #7

    I found a couple bugs that occurred when "p" was entered again in chat before a "u" was sent. Occasionally it crashed my pluto and other times it just left the "Game Paused" in the middle of my screen.

    I changed the script slightly to avoid this issue for anybody who is like me and too dumb to not put "p" in twice before "u." Once the "p" is sent it will only trigger again once "u" is sent.

    watchchatpause()
    {
    
        level endon("end_game");
    	self endon("disconnect");
        for(;;)
        {
    
        	level waittill("say", message, player);
    
        	if (message == "p")
        	{
        
        		self EnableInvulnerability();
        		self iprintln("Game Paused ");
        		self.ignoreme = 1;
        		self freezeControls(true);
        		level.gamestate = createServerFontString("hudsmall" , 31);
        		level.gamestate setPoint("CENTER", "TOP", "CENTER", 190);
        		level.gamestate setText("Game Paused");
        		level waittill("say", message1, player);
        		chatPauseFix(message1);
       		}
       		wait 0.05; 
    	}
    }
    
    chatPauseFix(m)
    {
    	if(m == "u")
        {
        	self iprintln("Game UnPaused ");
        	self freezeControls(false);
        	level.gamestate destroy();
        	self DisableInvulnerability();
        	self.ignoreme = 0;
        }
        else
        {
        	level waittill("say", chat, player);
        	chatPauseFix(chat);
        }
    }
    

    As far as I know this won't cause any bugs but who knows at this point.

    1 Reply Last reply
    0
    • hima_simpleundefined hima_simple

      Hello ,I have been looking around for a script or something to pause a game , it doesn't really pause the game but if anyone wants to go AFK no they can and that was one of my main goals.

      How to Use

      • open chat by pressing 'T'

      • Type 'p' and press Enter.

      • Type 'u' to unpause.

      How it works

      • Makes Player invisible to zombies.

      • Gives play Invariability so no damaged is caused.

      • Freezes player in place so No one uses the pause in a bad/spam way [to keep the game clean].

      GSC Code

      watchchatpause(){
      
          level endon("end_game");
      
          for(;;){
      
          level waittill("say", message, player);
      
          if (message == "p"){
          
          self EnableInvulnerability();
          self iprintln("Game Paused ");
          self.ignoreme = 1;
          player freezeControls(true);
          level.gamestate = createServerFontString("hudsmall" , 31);
          level.gamestate setPoint("CENTER", "TOP", "CENTER", 190);
          level.gamestate setText("Game Paused");
      
         }else if (message == "u"){
      
          self DisableInvulnerability();
          self iprintln("Game UnPaused ");
          self.ignoreme = 0;
          player freezeControls(false);
          level.gamestate setText("");
         }
           
         wait 0.05; 
      }
      
      
      }
      
      

      Screen Shot
      558d9580-71c2-4537-b591-8b2b1932ac73-image.png https://ibb.co/FwyMD3Q)

      Future Goals

      • Full Game Pause for all Player

      • Try to freeze zombies in there places / freeze zombie spawn

      • Better GUI / Shortcut for game pause like a press of a button

      thats hope this was useful and thank you ❤

      potatossssundefined Offline
      potatossssundefined Offline
      potatossss
      wrote on last edited by
      #8

      hima_simple can someone tell me how to get this running

      1 Reply Last reply
      0
      • hima_simpleundefined hima_simple

        Hello ,I have been looking around for a script or something to pause a game , it doesn't really pause the game but if anyone wants to go AFK no they can and that was one of my main goals.

        How to Use

        • open chat by pressing 'T'

        • Type 'p' and press Enter.

        • Type 'u' to unpause.

        How it works

        • Makes Player invisible to zombies.

        • Gives play Invariability so no damaged is caused.

        • Freezes player in place so No one uses the pause in a bad/spam way [to keep the game clean].

        GSC Code

        watchchatpause(){
        
            level endon("end_game");
        
            for(;;){
        
            level waittill("say", message, player);
        
            if (message == "p"){
            
            self EnableInvulnerability();
            self iprintln("Game Paused ");
            self.ignoreme = 1;
            player freezeControls(true);
            level.gamestate = createServerFontString("hudsmall" , 31);
            level.gamestate setPoint("CENTER", "TOP", "CENTER", 190);
            level.gamestate setText("Game Paused");
        
           }else if (message == "u"){
        
            self DisableInvulnerability();
            self iprintln("Game UnPaused ");
            self.ignoreme = 0;
            player freezeControls(false);
            level.gamestate setText("");
           }
             
           wait 0.05; 
        }
        
        
        }
        
        

        Screen Shot
        558d9580-71c2-4537-b591-8b2b1932ac73-image.png https://ibb.co/FwyMD3Q)

        Future Goals

        • Full Game Pause for all Player

        • Try to freeze zombies in there places / freeze zombie spawn

        • Better GUI / Shortcut for game pause like a press of a button

        thats hope this was useful and thank you ❤

        MufaDOOMundefined Offline
        MufaDOOMundefined Offline
        MufaDOOM
        wrote on last edited by
        #9

        hima_simple I found a way to freeze zombies (in this test i'm solo but it's work in coop too)

        link to the video : https://mega.nz/file/4Fhk0ZDY#lawaw7K-HzPZKn_UegCiGkIOj0V9necoSHETg7Jg-y4

        1 Reply Last reply
        0
        • hima_simpleundefined hima_simple

          Hello ,I have been looking around for a script or something to pause a game , it doesn't really pause the game but if anyone wants to go AFK no they can and that was one of my main goals.

          How to Use

          • open chat by pressing 'T'

          • Type 'p' and press Enter.

          • Type 'u' to unpause.

          How it works

          • Makes Player invisible to zombies.

          • Gives play Invariability so no damaged is caused.

          • Freezes player in place so No one uses the pause in a bad/spam way [to keep the game clean].

          GSC Code

          watchchatpause(){
          
              level endon("end_game");
          
              for(;;){
          
              level waittill("say", message, player);
          
              if (message == "p"){
              
              self EnableInvulnerability();
              self iprintln("Game Paused ");
              self.ignoreme = 1;
              player freezeControls(true);
              level.gamestate = createServerFontString("hudsmall" , 31);
              level.gamestate setPoint("CENTER", "TOP", "CENTER", 190);
              level.gamestate setText("Game Paused");
          
             }else if (message == "u"){
          
              self DisableInvulnerability();
              self iprintln("Game UnPaused ");
              self.ignoreme = 0;
              player freezeControls(false);
              level.gamestate setText("");
             }
               
             wait 0.05; 
          }
          
          
          }
          
          

          Screen Shot
          558d9580-71c2-4537-b591-8b2b1932ac73-image.png https://ibb.co/FwyMD3Q)

          Future Goals

          • Full Game Pause for all Player

          • Try to freeze zombies in there places / freeze zombie spawn

          • Better GUI / Shortcut for game pause like a press of a button

          thats hope this was useful and thank you ❤

          Ch00chinat0rundefined Offline
          Ch00chinat0rundefined Offline
          Ch00chinat0r
          wrote on last edited by
          #10

          hima_simple I threw the code into a text editor. Then compiled it to GSC. Threw it in .../local/plutonium/storage/t6/scripts/zm

          But when I run the server I get this error. Any ideas on how I can implement this into my self-hosted server?

          **** 2 script error(s):
          **** Unresolved external : "createserverfontstring" with 2 parameters in "chatpause" at line 1 ****
          **** Unresolved external : "setpoint" with 4 parameters in "chatpause" at line 1 ****

          Ekko420undefined 1 Reply Last reply
          2
          • Ch00chinat0rundefined Ch00chinat0r

            hima_simple I threw the code into a text editor. Then compiled it to GSC. Threw it in .../local/plutonium/storage/t6/scripts/zm

            But when I run the server I get this error. Any ideas on how I can implement this into my self-hosted server?

            **** 2 script error(s):
            **** Unresolved external : "createserverfontstring" with 2 parameters in "chatpause" at line 1 ****
            **** Unresolved external : "setpoint" with 4 parameters in "chatpause" at line 1 ****

            Ekko420undefined Offline
            Ekko420undefined Offline
            Ekko420
            wrote on last edited by
            #11
            This post is deleted!
            Ch00chinat0rundefined 1 Reply Last reply
            0
            • Ekko420undefined Ekko420

              This post is deleted!

              Ch00chinat0rundefined Offline
              Ch00chinat0rundefined Offline
              Ch00chinat0r
              wrote on last edited by
              #12

              Ekko420 Unfortunately not

              chicken emojiundefined 1 Reply Last reply
              0
              • Ch00chinat0rundefined Ch00chinat0r

                Ekko420 Unfortunately not

                chicken emojiundefined Offline
                chicken emojiundefined Offline
                chicken emoji
                wrote on last edited by chicken emoji
                #13

                Ch00chinat0r add this line at the very top and try again

                #include maps/mp/gametypes_zm/_hud_util;

                Ch00chinat0rundefined Danman360undefined 2 Replies Last reply
                0
                • chicken emojiundefined chicken emoji

                  Ch00chinat0r add this line at the very top and try again

                  #include maps/mp/gametypes_zm/_hud_util;

                  Ch00chinat0rundefined Offline
                  Ch00chinat0rundefined Offline
                  Ch00chinat0r
                  wrote on last edited by
                  #14

                  chicken emoji Thanks! That did fix the error! However typing "p" in chat isn't pausing the game in any way still..

                  chicken emojiundefined 1 Reply Last reply
                  0
                  • Ch00chinat0rundefined Ch00chinat0r

                    chicken emoji Thanks! That did fix the error! However typing "p" in chat isn't pausing the game in any way still..

                    chicken emojiundefined Offline
                    chicken emojiundefined Offline
                    chicken emoji
                    wrote on last edited by
                    #15

                    Ch00chinat0r thats because there is no main or init function so basically the mod doesnt do anything

                    Ch00chinat0rundefined 1 Reply Last reply
                    0
                    • chicken emojiundefined chicken emoji

                      Ch00chinat0r thats because there is no main or init function so basically the mod doesnt do anything

                      Ch00chinat0rundefined Offline
                      Ch00chinat0rundefined Offline
                      Ch00chinat0r
                      wrote on last edited by
                      #16

                      chicken emoji Ahh gotcha.. this is beyond my knowledge.. Thanks for the replies

                      chicken emojiundefined 1 Reply Last reply
                      0
                      • Ch00chinat0rundefined Ch00chinat0r

                        chicken emoji Ahh gotcha.. this is beyond my knowledge.. Thanks for the replies

                        chicken emojiundefined Offline
                        chicken emojiundefined Offline
                        chicken emoji
                        wrote on last edited by
                        #17
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • Samsundefined Offline
                          Samsundefined Offline
                          Sams
                          wrote on last edited by
                          #18

                          how do I download this script??

                          1 Reply Last reply
                          0
                          • chicken emojiundefined chicken emoji

                            Ch00chinat0r add this line at the very top and try again

                            #include maps/mp/gametypes_zm/_hud_util;

                            Danman360undefined Offline
                            Danman360undefined Offline
                            Danman360
                            wrote on last edited by
                            #19
                            This post is deleted!
                            1 Reply Last reply
                            0
                            • zzzslundefined Offline
                              zzzslundefined Offline
                              zzzsl
                              wrote on last edited by
                              #20

                              idk how 2 do this heres what i have

                              pause_system.gsc

                              #include maps\mp\gametypes_zm\_hud_util;
                              
                              watchchatpause()
                              {
                                  level endon("end_game");
                                  self endon("disconnect");
                              
                                  for (;;)
                                  {
                                      level waittill("say", message, player);
                              
                                      if (message == "p")
                                      {
                                          self EnableInvulnerability();
                                          self iprintln("Game Paused");
                                          self.ignoreme = 1;
                                          self freezeControls(true);
                              
                                          level.gamestate = createServerFontString("hudsmall", 31);
                                          level.gamestate setPoint("CENTER", "TOP", "CENTER", 190);
                                          level.gamestate setText("Game Paused");
                              
                                          level waittill("say", message1, player);
                                          chatPauseFix(message1);
                                      }
                                      wait 0.05;
                                  }
                              }
                              
                              chatPauseFix(m)
                              {
                                  if (m == "u")
                                  {
                                      self iprintln("Game UnPaused");
                                      self freezeControls(false);
                                      level.gamestate destroy();
                                      self DisableInvulnerability();
                                      self.ignoreme = 0;
                                  }
                                  else
                                  {
                                      level waittill("say", chat, player);
                                      chatPauseFix(chat);
                                  }
                              }
                              
                              

                              zm_mod.gsc

                              #include scripts\zm\pause_system;
                              
                              init()
                              {
                                  level thread watchchatpause();
                              }
                              
                              main()
                              {
                                  init(); 
                              }
                              
                              

                              how i fix pls

                              1 Reply Last reply
                              0
                              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
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Donate