# removeCommandHandler (Shared)

> Removes the handler this resource registered for a command.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Keyboard
- **URL**: https://wiki.mymp.gg/en/removeCommandHandler

## Syntax

```lua
bool removeCommandHandler(string commandName)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `commandName` | `string` | The command's name. Case matters. |

## Returns

`true` if it was removed. `false` if this resource has no handler with that name.

Handlers other resources registered for the same command stay.

## Example

```lua
local function onTeleport(player)
    setElementPosition(player, 2495.1, -1687.4, 13.5)
    removeCommandHandler("casa")
end
addCommandHandler("casa", onTeleport)
```

## See also

- [addCommandHandler (Shared)](https://wiki.mymp.gg/en/addCommandHandler.md): Registers a function that runs when the command is typed in the console. The arguments arrive as space-separated strings.
- [executeCommandHandler (Server)](https://wiki.mymp.gg/en/executeCommandHandler-server.md): Runs the handlers server scripts registered for a command, as if the player had typed it.
- [executeCommandHandler (Client)](https://wiki.mymp.gg/en/executeCommandHandler-client.md): Runs the handlers client scripts registered for a command, as if it had been typed.
