AddCommand: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 18: | Line 18: | ||
end | end | ||
AddCommand("commands", cmd_commands) | AddCommand("commands", cmd_commands) | ||
AddCommand("cmds", | AddCommand("cmds", cmd_commands) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
__EDIT_ME__ | __EDIT_ME__ |
Revision as of 14:47, 17 November 2019
Description
Adds a command that can be executed with the prefix /.
Syntax
AddCommand(CommandName, LuaFunction)
Parameters
- CommandName
The specified command name. - LuaFunction
The function name.
Return Value
- None.
Example
function cmd_commands(playerid)
AddPlayerChat(playerid, "You just executed a command!")
return
end
AddCommand("commands", cmd_commands)
AddCommand("cmds", cmd_commands)
See also
__EDIT_ME__