> For the complete documentation index, see [llms.txt](https://devmosaic.gitbook.io/devmosaic/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devmosaic.gitbook.io/devmosaic/resources/devmosaic-dm-chat/commands-and-controls.md).

# Commands And Controls

Reference for dm-chat player commands, ACE permissions, input keys, suggestions, and message history.

Press `T` to open the chat. The current interface is command-focused: submitted text must begin with `/`. Use `/say` when you want to send a normal global message.

## Commands

| Command                | Scope                 | Purpose                                                   |
| ---------------------- | --------------------- | --------------------------------------------------------- |
| `/say <message>`       | Global                | Sends a normal message through the standard chat router   |
| `/ooc <message>`       | `Config.OOCDistanc`   | Sends an out-of-character message to nearby players       |
| `/me <action>`         | `Config.MeDoeDistanc` | Adds an orange action message and an above-head popup     |
| `/do <description>`    | `Config.MeDoeDistanc` | Adds a blue description message and a thought-style popup |
| `/gif <direct URL>`    | 25-unit popup         | Displays a direct GIF above the player for five seconds   |
| `/music <URL>`         | Sender only           | Opens a direct-audio or YouTube media card for the caller |
| `/video <YouTube URL>` | Sender only           | Opens an embedded YouTube card for the caller             |
| `/clear`               | Sender only           | Clears the caller's chat feed                             |
| `/clearall`            | All players           | Clears every connected player's chat feed                 |

The feature switches in `config.lua` control `/say`, `/ooc`, `/me`, `/do`, `/gif`, `/music`, and `/video`.

## clearall permission

`/clearall` is registered as a restricted FiveM command. Grant its ACE object to an administrator group:

```cfg
add_ace group.admin command.clearall allow
```

Players without `command.clearall` do not receive that command through the automatic permitted-command list.

## Input controls

| Key                     | Action                                                                          |
| ----------------------- | ------------------------------------------------------------------------------- |
| `T`                     | Open chat and focus the input                                                   |
| `Enter`                 | Submit the current command and close chat                                       |
| `Escape`                | Close chat without submitting                                                   |
| `Up` / `Down`           | Move through matching suggestions, or command history when no suggestions match |
| `Tab`                   | Complete the selected suggestion                                                |
| `Page Up` / `Page Down` | Scroll the chat feed                                                            |

The UI keeps the last 50 submitted entries for the current NUI session.

## Command suggestions

On load, the client reads registered FiveM commands and only adds commands for which the player passes `IsAceAllowed('command.<name>')`. Other resources can also add suggestions through the standard chat event or export.

Typing filters the list. Use the arrow keys to select a result and `Tab` to put it in the input.

{% hint style="info" %}
Disabling a dm-chat feature prevents its command from running, but its static suggestion can still appear. This does not mean the disabled command is active.
{% endhint %}

## FiveM formatting codes

Messages support FiveM colour codes `^0` through `^9` and bold code `^*`. These codes affect rendered chat text and are removed from plain copied console text.
