Garry's Mod Wiki

concommand

The concommand library is used to create console commands which can be used to network (basic) information & events between the client and the server.

Methods

concommand.Add( string name, function callback, function autoComplete = nil, string helpText = "nil", number flags = 0 )
Creates a console command that runs a function in lua with optional autocompletion function and help text. This will fail if the concommand was previously removed with concommand.Remove in a different realm (creating a command on the client that was removed from the server and vice-versa).
table concommand.AutoComplete( string command, string arguments )
This is used internally - although you're able to use it you probably shouldn't. Used by the engine to call the autocomplete function for a console command, and retrieve returned options.
table, table concommand.GetTable()
Returns the tables of all console command callbacks, and autocomplete functions, that were added to the game with concommand.Add.
concommand.Remove( string name )
Removes a console command. This will not always remove the command from auto-complete.concommand.Add will fail if the concommand was previously removed with this function in a different realm (creating a command on the client that was removed from the server and vice-versa).
boolean concommand.Run( Player ply, string cmd, any args, string argumentString )
This is used internally - although you're able to use it you probably shouldn't. You might be looking for RunConsoleCommand or Player:ConCommand. Used by the engine to run a console command's callback function. This will only be called for commands that were added with AddConsoleCommand, which concommand.Add calls internally. An error is sent to the player's chat if no callback is found. This will still be called for concommands removed with concommand.Remove but will return false.

Page Links


Special Pages


Wikis

?

Render Time: 24ms

DB GetPage 3
Generate Html 2
SaveChanges (1) 11
Render Body 0
Render Sidebar 6