> 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/installation.md).

# Installation

Install dm-chat, replace the default FiveM chat, and configure the clearall ACE permission.

{% stepper %}
{% step %}

## Add the resource

Place the complete `dm-chat` folder in your resources directory. Keep its name exactly as supplied.

```
resources/
└── [dm-scripts]/
    └── dm-chat/
```

{% endstep %}

{% step %}

## Install ox\_lib

`dm-chat` loads `@ox_lib/init.lua`, so install `ox_lib` if it is not already on the server. Start it before the chat.
{% endstep %}

{% step %}

## Disable the default chat

Only one chat interface should run. Remove or comment out the old FiveM chat entry in `server.cfg`:

```cfg
# ensure chat
```

{% hint style="warning" %}
If another chat resource is installed, disable that resource too. Running two chat interfaces causes duplicate messages and competing input focus.
{% endhint %}
{% endstep %}

{% step %}

## Start dm-chat

Use this order in `server.cfg`:

```cfg
ensure ox_lib
ensure dm-chat
```

{% endstep %}

{% step %}

## Grant the clearall permission

`/clearall` is ACE-restricted. Grant it only to the group that should be able to clear every player's chat:

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

`/clear` only clears the caller's own chat and needs no ACE rule.
{% endstep %}

{% step %}

## Configure and test

Edit `dm-chat/config.lua`, save it, and restart the resource:

```
restart dm-chat
```

Join the server, press `T`, and test `/me waves`. See [Configuration](/devmosaic/resources/devmosaic-dm-chat/configuration.md) for every available setting.
{% endstep %}
{% endstepper %}

## Resource structure

| Path              | Purpose                                                     |
| ----------------- | ----------------------------------------------------------- |
| `config.lua`      | Timers, distances, feature switches, colours, and emojis    |
| `client/main.lua` | NUI bridge, chat compatibility, focus, and proximity popups |
| `server/main.lua` | Commands, routing, permissions, modes, and message hooks    |
| `web/index.html`  | Chat interface structure                                    |
| `web/style.css`   | Layout, typography, message styles, and animations          |
| `web/script.js`   | Input, messages, suggestions, popups, and media players     |

{% hint style="info" %}
No npm install or web build is required. Normal customization only requires `config.lua`.
{% endhint %}

## Optional join and quit messages

Join and quit announcements are enabled by default. Disable either one in `server.cfg` when another resource already provides these notifications:

```cfg
set chat_showJoins 0
set chat_showQuits 0
```

Use `1` to enable a message again, then restart `dm-chat`.
