Garry's Mod Wiki

RunGameUICommand

  RunGameUICommand( string command )

Description

Runs a menu command. Equivalent to RunConsoleCommand( "gamemenucommand", command ) unless the command starts with the "engine" keyword in which case it is equivalent to RunConsoleCommand( command ).

Invoking engine commands no longer works, prints out Not running engine cmd 'concommand'

Arguments

1 string command
The menu command to run

Should be one of the following:

  • Disconnect - Disconnects from the current server.
  • OpenBenchmarkDialog - Opens the "Video Hardware Stress Test" dialog.
  • OpenChangeGameDialog - Does not work in GMod.
  • OpenCreateMultiplayerGameDialog - Opens the Source dialog for creating a listen server.
  • OpenCustomMapsDialog - Does nothing.
  • OpenFriendsDialog - Does nothing.
  • OpenGameMenu - Does not work in GMod.
  • OpenLoadCommentaryDialog - Opens the "Developer Commentary" selection dialog. Useless in GMod.
  • OpenLoadDemoDialog - Does nothing.
  • OpenLoadGameDialog - Opens the Source "Load Game" dialog.
  • OpenNewGameDialog - Opens the "New Game" dialog. Useless in GMod.
  • OpenOptionsDialog - Opens the options dialog.
  • OpenPlayerListDialog - Opens the "Mute Players" dialog that shows all players connected to the server and allows to mute them.
  • OpenSaveGameDialog - Opens the Source "Save Game" dialog.
  • OpenServerBrowser - Opens the legacy server browser.
  • Quit - Quits the game without confirmation (unlike other Source games).
  • QuitNoConfirm - Quits the game without confirmation (like other Source games).
  • ResumeGame - Closes the menu and returns to the game.
  • engine 'concommand' - Runs a console command. Unlike RunConsoleCommand It will ignore Blocked ConCommands

Example

Opens the options dialog.

RunGameUICommand( "OpenOptionsDialog" )

Example

Hides the game UI (menu). Equivalent to RunConsoleCommand( "gameui_hide" )

RunGameUICommand( "engine gameui_hide" )