game.ConsoleCommand

From GMod Wiki

Jump to: navigation, search
Function
Syntax game.ConsoleCommand( String command )
Where is this used?
Description:
Runs a console command on the server. Similar to _ServerCommand in GM9.
Returns: nil
Part of Library: game
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Game.ConsoleCommand]Game.ConsoleCommand [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis will make the server say 'Cake' in everyone's chat.
Used onNewerServer.png
Code
game.ConsoleCommand("say Cake\n")
OutputNone


Additional Notes

 
"con_enable"
"sv_cheats",
"_restart",
"exec",
"condump",
"connect",
"bind",
"BindToggle",
"alias",
"ent_fire",
"ent_setname",
"sensitivity",
"name",
"r_aspect",
"quit",
"exit",
"lua_run",
"lua_run_cl",
"lua_open",
"lua_cookieclear",
"lua_showerrors_cl",
"lua_showerrors_sv",
"lua_openscript",
"lua_openscript_cl",
"lua_redownload",
"sent_reload",
"sent_reload_cl",
"swep_reload",
"swep_reload_cl",
"gamemode_reload",
"gamemode_reload_cl",
"con_logfile",
"clear",
"rcon_password",
"test_RandomChance",
"plugin_load",
 

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox