concommand/Run

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Add "view source" link)
(Note the actual calling behaviour of this function)
 
Line 1: Line 1:
 
{{Func
 
{{Func
|Description={{Internal|You might be looking for {{GlobalFunction|RunConsoleCommand}} or {{ClassFunction|Player|ConCommand}}.}} Used by the engine to run a console command's callback function, that was added with {{LibraryFunction|concommand|Add}}. An error is sent to the player's chat if no callback is found.
+
|Description={{Internal|You might be looking for {{GlobalFunction|RunConsoleCommand}} or {{ClassFunction|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 {{GlobalFunction|AddConsoleCommand}}, which {{LibraryFunction|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 {{LibraryFunction|concommand|Remove}} but will return false.
 
|Realm=Shared and Menu
 
|Realm=Shared and Menu
 
|IsClass=No
 
|IsClass=No

Latest revision as of 21:58, 6 November 2019

 concommand.Run( )

Contents

Description

This is an internal function or feature.
This means you will be able to use it, but you really 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.

Arguments

Player ply

Player to run concommand on

Arguments

string cmd

Command name

Arguments

any args

Command arguments.

Can be table or string

Arguments

string argumentString

string of all arguments sent to the command

Returns

boolean

true if the console command with the given name exists, and false if it doesn't.
Personal tools
Navigation