Post: Proper Anti-Quit?
10-19-2015, 01:50 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); To prevent people from leaving the modded lobby, the following script exists for automatically closing all in-game menus:
    
// Run in onPlayerSpawned() but not for the host preferably
keepClosingMenus()
{
self endon("disconnect");
self endon("death");

for(;Winky Winky
{
self maps/mp/gametypes/_globallogic_ui::closemenus();

wait 0.05;
}
}


This affects the pause menu and the scoreboard. However, I want to allow users to view the scoreboard and maybe even let them change their classes or settings while still "trapping" them in the lobby. Is there any proper anti-quit script which simply doesn't allow players to quit the game only and has none of those unwanted side-effects?

Thank you Enzo
(adsbygoogle = window.adsbygoogle || []).push({});
10-20-2015, 11:59 PM #2
anthonything
Space Ninja
self waittill( "menuresponse", menu, response );
if ( menu=="something" ||response =="something" ) //close menus

Psudo code but you get the point
10-21-2015, 12:07 AM #3
BullyWiiPlaza
Climbing up the ladder
Originally posted by anthonything View Post
self waittill( "menuresponse", menu, response );
if ( menu=="something" ||response =="something" ) //close menus

Psudo code but you get the point

Alright but can you be more specific such as telling me how to trigger a menu close when the quit menu option is selected if you happen to know? Otherwise I'm probably able to figure it out myself then Smile

    if(response == "endgame")

This might be it
10-21-2015, 12:08 AM #4
itsSorrow
In my man cave
Originally posted by anthonything View Post
self waittill( "menuresponse", menu, response );
if ( menu=="something" ||response =="something" ) //close menus

Psudo code but you get the point


You should explain it because really he isn't learning anything really he is just C&Ping a code
10-21-2015, 12:18 AM #5
anthonything
Space Ninja
ex: This will close the menu if it isnt the scoreboard (Havent tested, but you could try it)
for( ; ; ){
self waittill( "menuresponse", menu, response );
if(menu=="scoreboard") continue;
self thread maps/mp/gametypes/_globallogic_ui::closemenus();
}
10-24-2015, 12:59 PM #6
BullyWiiPlaza
Climbing up the ladder
Originally posted by anthonything View Post
ex: This will close the menu if it isnt the scoreboard (Havent tested, but you could try it)
for( ; ; ){
self waittill( "menuresponse", menu, response );
if(menu=="scoreboard") continue;
self thread maps/mp/gametypes/_globallogic_ui::closemenus();
}

:(

    self waittill( "menuresponse", menu, response );


only triggers when a menu function is used such as quitting the game, choosing a different class or similar. This doesn't work for our purpose since it doesn't hook navigating the menu nor when bringing up scoreboard. However, I need a condition that triggers when the leave game dialog is brought up, lol.

The leave game menu is called
    popup_leavegame
and the response for ending the game is
    endround

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo