A Simple Pause Script for BO2 Zombies
-
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
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
-
-
best software developer
-
hima_simple Great Job brother.
Mido.MK47 OMG Ahmed Mousa, what brought you here? xD
-
amazing you should work vanguard !
-
-
@dontknowletsplay alright will update it + i need to do more improvement
-
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.
-
hima_simple can someone tell me how to get this running
-
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
-
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 **** -
This post is deleted!
-
Ekko420 Unfortunately not
-
Ch00chinat0r add this line at the very top and try again
#include maps/mp/gametypes_zm/_hud_util;
-
chicken emoji Thanks! That did fix the error! However typing "p" in chat isn't pausing the game in any way still..
-
Ch00chinat0r thats because there is no main or init function so basically the mod doesnt do anything
-
chicken emoji Ahh gotcha.. this is beyond my knowledge.. Thanks for the replies
-
This post is deleted!
-
how do I download this script??
-
This post is deleted!
-
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