Difference between revisions of "ScriptHook.RegisterCommand"

From Nomad DB
(Created page with "This function is used to register commands to the Ingame Console. == Syntax == <syntaxhighlight lang="lua"> ScriptHook.RegisterCommand(name, callb...")
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
This function is used to register commands to the [[WD2 ScriptHook: Console|Ingame Console]].
+
This function is used to register commands to the [[ScriptHook: Console|Ingame Console]].
  
 
== Syntax ==
 
== Syntax ==
Line 8: Line 8:
 
* '''callback''' (function) Command function
 
* '''callback''' (function) Command function
 
* '''Returns: [[ICommandRegistry]]'''
 
* '''Returns: [[ICommandRegistry]]'''
 
== Example ==
 
  
 
== Related Pages ==
 
== Related Pages ==
 
* [[ICommandRegistry]]
 
* [[ICommandRegistry]]
 
* [[ICommandRegistry:AddArgument]]
 
* [[ICommandRegistry:AddArgument]]
* [[WD2 ScriptHook: Console Commands]]
+
* [[ScriptHook: Console Commands]]
  
[[Category:WD2 ScriptHook Lua]]
+
[[Category:ScriptHook Lua]]

Latest revision as of 12:57, 6 October 2020

This function is used to register commands to the Ingame Console.

Syntax

ScriptHook.RegisterCommand(name, callback)
  • name (string) Name of the command
  • callback (function) Command function
  • Returns: ICommandRegistry

Related Pages