Chat Theme Documentation

Core Features

Message Templates

Design messages with full control:

Config.Theme['cmd:me'] = T.build()
    :bg('#ffffff20')          -- Background color
    :tag('ME', '#E8A838')     -- Badge
    :author({ bold = true })  -- Player name (bold)
    :text(': ')               -- Static text
    :message()                -- Message content
    :done()

Channels with Permissions

Config.Channels = {
    {
        id = 'police',
        label = 'Police Radio',
        participants = {
            read  = { { type = 'job', value = 'police' } },
            write = { { type = 'job', value = 'police' } },
        },
    }
}

Job Whisper System

Config.JobWhisper = {
    policeRadio = {
        command = "r",
        sender = { job = "police", grade = 0 },
        receivers = {
            { job = "police", grade = 0 },
        },
    }
}

Built-in Commands

Command Purpose Visibility
/me [action] Roleplay action Proximity (10m)
/do [desc] Environment description Proximity (10m)
/ooc [text] Out-of-character Proximity (50m)
/msg [id] [text] Private message Only target
/twitter [text] Global announcement Everyone
/dice [max] Roll dice Proximity (15m)
/try [action] 50/50 success/fail Proximity (15m)

Key Concepts

Placeholders

Dynamic values that get replaced at runtime:

{Framework:GetName}              -- Player character name
{Framework:GetJob}               -- Current job
{Placeholder:ServerId}           -- Server player ID
{Masked:Framework:GetName}       -- "Anonymous" if masked
{Friends:Framework:GetName}      -- Only visible to friends

Components

Build messages from components:

T.tag('TEXT')              -- Badge
T.author()                 -- Player name
T.message()                -- Message content
T.text('static text')      -- Static content
T.icon(svgString)          -- SVG icon
T.spacer()                 -- Spacing
T.bold(), T.italic()       -- Formatting

Broadcasting

Send messages with different visibility:

Commands.sendProximity(template, args, range)      -- Nearby players
Commands.sendProximityLos(template, args, range)   -- Line of sight
Commands.sendPrivate(targetId, template, args)    -- One player
Commands.sendAll(template, args)                   -- Everyone

Installation Overview

# 1. Download from releases
# 2. Extract to resources/of_chat_theme
# 3. Add to server.cfg
ensure chat
ensure of_chat_theme

# 4. Restart server - Done!

All features work out of the box. Customize with config files.

File Structure

of_chat_theme/
└── config/                    # User configuration
    ├── config.lua            # Main settings
    ├── templates.lua         # Message designs
    ├── channels.lua          # Channel definitions
    ├── commands/
    │   ├── client.lua        # Client commands
    │   └── server.lua        # Server commands
    ├── placeholders.lua      # Custom placeholders
    ├── automessages.lua      # Scheduled messages
    └── locales/              # Translations

Frameworks Supported

  • QBCore (1.2+) - Full support
  • QBX - Full support
  • ESX (Latest) - Full support

Framework detection is automatic. Override with Config.Framework.

Dependencies

Required:

  • chat - FiveM native chat
  • ox_lib - Libraries and utilities

Optional:

  • ox_target or qb-target - Target framework
  • qb-logs - Automatic chat logging
  • LB-PHONE - Phone integration

Learning Path

  1. Start here: Quick Start - 5 minute setup
  2. Basic usage: Commands - Built-in commands
  3. Customization: Templates - Design messages
  4. Advanced: Configuration - Full reference
  5. Troubleshooting: FAQ - Common issues

Version

Current version: 2.0.0+

Check Installation for version requirements.


Ready to get started?Quick Start Guide