Garry's Mod Wiki

Garry's Mod Wiki

  game.ConsoleCommand( string stringCommand )

Description

Runs a console command. Make sure to add a newline ("\n") at the end of the command.

If you use data that were received from a client, you should avoid using this function because newline and semicolon (at least) allow the client to run arbitrary commands!

For safety, you are urged to prefer using RunConsoleCommand in this case.

Arguments

1 string stringCommand
String containing the command and arguments to be ran.

Example

Changes the gravity to 400 (default 600).

game.ConsoleCommand("sv_gravity 400\n")

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...