ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. removeCommandHandler

Function

removeCommandHandler

Server and clientInput and controlsIdentical to MTA:SA

Removes a command added with addCommandHandler. With a function it removes only that handler; without one it removes every handler of the command.

Syntax

bool removeCommandHandler(string commandName [, function handler])

Arguments

commandNamestring
Command name.
handlerfunction, optional
The function to detach.

Returns

true if something was removed.

Example

local function startRace(player)
    outputChatBox("Start!", root)
    removeCommandHandler("start", startRace)
end
addCommandHandler("start", startRace)

See also