# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coderanch-redm-store.gitbook.io/coderanch-redm-store-docs/coderanch-cchat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
