game.ConsoleCommand
From GMod Wiki
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: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Game.ConsoleCommand]Game.ConsoleCommand [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | This will make the server say 'Cake' in everyone's chat. |
---|---|
Used on | |
Code | game.ConsoleCommand("say Cake\n") |
Output | None |
Additional Notes
- The command needs to be ended with a \n to be run, as shown in the examples.
- The following commands are blocked:
"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",