Garry's Mod Wiki

GM:OnPauseMenuShow

  boolean GM:OnPauseMenuShow()

Recently Added

This was recently added in version (2024.07.11). It might only be available on the Dev Branch right now.

Description

Called when the pause menu is attempting to be opened. Allows you to prevent the main menu from being opened that time.

The user can hold ⇧ shift to not call this hook. If the main menu is blocked multiple times in short succession, a warning will be displayed to the end user on how to bypass the hook.

Returns

1 boolean ShouldOpen
Should the menu be allowed to open?

Example

Stops the main menu from opening

hook.Add( "OnPauseMenuShow", "DisableMenu", function() chat.AddText( "Press Shift+Escape to open the menu." ) return false end )