game.ConsoleCommand

From Garry's Mod
Revision as of 17:01, 2 July 2017 by EstevanTH (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 game.ConsoleCommand( )

Contents

Description

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

WARNING

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

string stringCommand

String containing the command and arguments to be ran.

Examples

Example

Changes the gravity to 400 (default 600).

game.ConsoleCommand("sv_gravity 400\n")


Personal tools
Navigation