removeCommandHandler
Client-side
Server-side
Shared
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function removes a command handler, that is one that has been added using addCommandHandler. This function can only remove command handlers that were added by the resource that it is called in.
Syntax
removeCommandHandler ( )Code Examples
server
This example adds a command handler that briefly shows the position of 'huntedPlayer', and removes the command handler when 'huntedPlayer' dies:
-- add a command that allows players to see the position of the 'huntedPlayer' for 5 seconds:function consoleShowHuntedBlip ( thePlayer, commandName ) local x, y, z = getElementPosition ( huntedPlayer ) local huntedblip = createBlip ( x, y, z, 0, 2, 255, 0, 0, 255, thePlayer ) setTimer ( "destroyElement", 5000, 1, huntedblip )endaddCommandHandler ( "showhuntedblip", consoleShowHuntedBlip )
-- remove the command once the hunter player dies:function onHuntedPlayerWasted ( ammo, killer, killerweapon, bodypart ) removeCommandHandler ( "showhuntedblip" )endaddEventHandler ( "onPlayerWasted", huntedPlayer, onHuntedPlayerWasted )See Also
Input Functions
- addCommandHandler
- bindKey
- executeCommandHandler
- getAnalogControlState
- getBoundKeys
- getCommandHandlers
- getCommandsBoundToKey
- getFunctionsBoundToKey
- getKeyBoundToCommand
- getKeyBoundToFunction
- getKeyState
- isCapsLockEnabled
- isControlEnabled
- isKeyBound
- removeCommandHandler
- setAnalogControlState
- toggleAllControls
- toggleControl
- unbindKey
Input Events
- onClientCharacter
- onClientClick
- onClientCursorMove
- onClientDoubleClick
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientKey
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel
- onClientPaste