Quit the game cleanly
game_quitQuits a Garry's Mod instance cleanly: it saves config and video settings, then exits, which also stops that instance's MCP server. Use instances_close for test clients launched by instances_launch.
Instructions
Asks the game to quit cleanly (console quit): it saves its config (cfg/config.cfg, video settings) and exits; the MCP server of this instance goes away with it. For test clients started by instances_launch, prefer instances_close (it kills the process: nothing is saved, and the exit is short); game_quit is safe on them too: before quitting, the module gives the archived convars their command line changed (fps_max, fps_max_nofocus, snd_mute_losefocus, and those named by instances_launch commands or launch_args) the user's values from cfg/config.cfg, or their defaults when the file has no line. On a dedicated server the console quit is blocked from server Lua: on Linux the module then ends the process itself with SIGTERM (the server's own clean shutdown, half a second after the answer); where that is not possible (Windows srcds) the error is blocked and nothing quits. Result: {quitting: true}; on the coordinator while other instances live, also coordinator_moved: true, remaining_instances and a warning (they elect a new coordinator).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "game_quit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance | No | Optional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next | No | ||
| note | No | ||
| warning | No | ||
| quitting | Yes | ||
| next_call | No | ||
| answered_by | No | ||
| truncated_note | No | ||
| version_warning | No |