# CodeRanch - cChat

Modern chat system for RedM (VORP / RSGCore).

### Requirements

* RedM server
* `cBase` resource (declared as a dependency)

### Installation

1. Drop the `cChat` folder into your `resources` directory.
2. Add `ensure cChat` to your `server.cfg` (after `cBase`).
3. Restart the server.

### Configuration

Edit `config.lua`:

* `Config.RestrictedWords` — list of forbidden words (case-insensitive, ignores spaces/symbols).
* `Config.RestrictedWordMessage` — message shown when a player's input is rejected.

### Default Keybinds

* `T` — open chat input
* `LALT` — open chat settings
* `Esc` — close chat / settings

### Player Settings

Players can customize their chat from the settings panel (`LALT`). All preferences are saved to `localStorage`:

* Theme (Vyren / Nexori / Aevon)
* Chat size (1 / 2 / 3)
* Font (Manrope / Roboto / Poppins / Default)
* Chat position (top-left / top-right / bottom-left / bottom-right)
* Profile picture source (Steam / Discord)
* Message sound on/off
* Text formatting mode on/off
* Mentions on/off

### Changing the Server Icon

The icon shown next to messages is `server-icon.png` in the resource root.

1. Replace `cChat/server-icon.png` with your own PNG (square recommended, e.g. 128x128).
2. Keep the **same filename** (`server-icon.png`).
3. Restart the resource (`restart cChat`).

### Changing the Message Sound

The notification sound played when receiving a message is `message-sfx.mp3` in the resource root.

1. Replace `cChat/message-sfx.mp3` with your own MP3.
2. Keep the **same filename** (`message-sfx.mp3`).
3. Restart the resource (`restart cChat`).

> Both files are declared in `fxmanifest.lua` under `files {}`. If you want to use a different filename, update the manifest and the references in `web/src/components/Chat.vue` (sound) and `web/src/components/MessageItem.vue` (icon), then rebuild the UI.
