Skip to content

CB Chat ​

A standalone roleplay chat replacement for RedM with channel filtering, 3D roleplay text, typing indicators, player-specific appearance settings, and compatibility with the standard Cfx chat events.

Current resource version: 1.0.1
Framework: Standalone
Dependencies: None

Features ​

  • All, Me/Do, and Newspaper channel tabs
  • /me and /do world-space text above characters
  • Live typing indicator
  • Per-player colours, scale, and draggable position stored in resource KVP
  • Responsive NUI for common resolutions and ultrawide displays
  • Command suggestions and command history
  • Five-message on-screen history limit
  • Cfx-compatible chat themes and message events

Installation ​

  1. Copy the inner cb-chat directory to your resources folder.
  2. Disable the stock chat resource or any other replacement chat. Two active chat UIs will conflict.
  3. Add ensure cb-chat to server.cfg.
  4. Restart the server, or run refresh followed by ensure cb-chat.

Controls and commands ​

InputAction
TOpen chat using the standard chat key mapping.
EnterSend the current message.
EscClose without sending.
Up / DownNavigate sent-message history.
Page Up / Page DownScroll visible messages.
/me <action>Local roleplay action and white 3D text.
/do <description>Local scene description and red 3D text.
/ooc <message>Out-of-character message.
/newspaper <text>In-character newspaper broadcast.
/clearchatClear the local player's chat window.
/say <message>Broadcast a plain message; also usable from the server console.

Standard chat events ​

CB Chat listens for the familiar Cfx chat events, so existing scripts can integrate without depending on its NUI internals.

lua
TriggerClientEvent('chat:addMessage', source, {
    color = { 255, 255, 255 },
    multiline = true,
    args = { 'Server', 'Welcome to the server.' }
})

Supported client events include chat:addMessage, chat:addSuggestion, chat:addSuggestions, chat:removeSuggestion, chat:addTemplate, and chat:clear.

lua
TriggerClientEvent('chat:addSuggestion', source, '/example', 'Example command', {
    { name = 'value', help = 'Value to submit' }
})

Customization ​

The shipped html/ folder is generated. Edit the React/Next.js source under nui/, not the generated output.

AreaLocation
Layout, fonts, and CSS variablesnui/app/globals.css
Tabs, defaults, message limit, bubble lifetimenui/lib/config.js
Server command formattingserver/commands.lua
3D range and projectionclient/cl_chat.lua
Settings iconnui/public/img/preloader.png

After changing the NUI:

bash
cd nui
npm install
npm run build

Commit and distribute the rebuilt html/ directory with the resource.

Chat themes ​

Other resources may declare a chat_theme metadata block. CB Chat supports injected stylesheets, styles, scripts, and message templates. Legacy stock-chat DOM template overrides are not supported.

Troubleshooting ​

Chat opens twice ​

Disable the stock chat resource and any other chat replacement.

UI edits do not appear ​

Rebuild the NUI and confirm the updated files were copied into html/. Editing nui/ alone does not change the in-game resource.

Commands do not appear in suggestions ​

Restart the affected resource or CB Chat so the client refreshes registered command suggestions.

Settings reset ​

Settings are stored per client with resource KVP. Renaming the resource or clearing client storage creates a fresh settings profile.