AddCommand

From Onset Developer Wiki
Revision as of 14:46, 17 November 2019 by 28days (talk | contribs)
AddCommand

Type: Function
Context: Server
Introduced: v1.0

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_cmds)

See also

__EDIT_ME__