> For the complete documentation index, see [llms.txt](https://hate-development.gitbook.io/hate-development-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hate-development.gitbook.io/hate-development-docs/dayz-chat.md).

# DayZ Chat

## Overview

**Advanced Chat System** is a premium, feature-rich FiveM resource designed specifically for serious roleplay servers. Built with performance and user experience in mind, this system provides everything you need for immersive in-character communication, out-of-character coordination, and server administration.

### Why Choose This Chat System?

* **Framework Agnostic**: Full support for both ESX and QBCore frameworks
* **Squad Integration**: Seamless integration with hate-squad resource for tactical communication
* **Multi-Mode Chat**: Normal, Squad, and Global OOC modes with easy toggle system
* **Roleplay Focused**: Extensive roleplay commands with 3D text display
* **Anti-Spam Protection**: Advanced spam detection and rate limiting
* **Discord Integration**: Comprehensive logging with webhook support
* **Highly Configurable**: Over 100+ configuration options
* **Visual Excellence**: Beautiful UI with smooth animations and effects

***

## Key Features

### Communication Features

* **Proximity Chat**: Distance-based communication with customizable ranges
* **3D Text Display**: Messages appear above player heads with stunning visual effects
* **Multiple Chat Modes**:
  * Normal proximity chat
  * Squad-only communication (with hate-squad integration)
  * Global Out-of-Character chat
* **Voice Levels**: Whisper, normal, and shout with different ranges
* **Private Messaging**: Send direct messages to specific players

### Roleplay Commands

* **Action Commands**: `/me`, `/do` for immersive roleplay
* **Atmospheric Commands**: `/ame`, `/amy` for above-head actions
* **Game Commands**: `/roll` dice, `/flipcoin` with animations
* **Location-based Actions**: Commands that work within specific areas

### Administration Tools

* **Report System**: Comprehensive player reporting with admin management
* **Announcement System**: Server-wide and event announcements
* **Chat Moderation**: Word filtering and message validation
* **Permission System**: ACE-based permission control
* **Discord Logging**: Detailed logs for all chat activities

### Visual & UX Features

* **Modern UI**: Clean, responsive chat interface
* **Chat Suggestions**: Auto-complete for commands with helpful hints
* **Visual Indicators**: Clear mode indicators and status displays
* **Smooth Animations**: Fade effects and transitions
* **Customizable Themes**: Adaptable color schemes and fonts

### Security & Performance

* **Spam Protection**: Multi-layer anti-spam system
* **Rate Limiting**: Prevent chat flooding per player
* **Input Validation**: Secure message processing
* **Optimized Code**: Efficient event handling and minimal resource usage
* **Error Handling**: Robust error management and fallbacks

### Integration Capabilities

* **Framework Support**: ESX and QBCore ready
* **Third-party Resources**: Compatible with popular resources
* **Webhook Support**: Discord, Slack, and custom webhook integration
* **Database Integration**: Optional database logging
* **API Endpoints**: Extensible for custom integrations

### Mobile & Accessibility

* **Responsive Design**: Works perfectly on all screen sizes
* **Keyboard Shortcuts**: Quick access to features
* **Accessibility Options**: Support for various accessibility needs
* **Multi-language Support**: Localization system for international servers

***

## Table of Contents

* [Installation](#installation)
* [Framework Configuration](#framework-configuration)
* [General Settings](#general-settings)
* [Squad Mode Settings](#squad-mode-settings)
* [Global OOC Settings](#global-ooc-settings)
* [Spam Protection](#spam-protection)
* [Chat Message Settings](#chat-message-settings)
* [3D Text Display](#3d-text-display-settings)
* [Proximity Settings](#proximity-settings)
* [Discord Integration](#discord-webhook-settings)
* [Report System](#report-system-settings)
* [Economy Settings](#money--economy-settings)
* [Animation Settings](#animation-settings)
* [Command Configuration](#command-configuration)
* [Localization](#localization)

***

## Installation

### Installation Steps

1. **Download & Extract**: Place the chat resource in your `resources/[fivem]/[cfx-default]/[gameplay]/` folder
2. **Server Configuration**: Add `ensure chat` to your `server.cfg`
3. **Framework Setup**: Configure your framework (ESX/QBCore) in `config.lua`
4. **Dependencies**: Install optional dependencies:
   * `hate-squad` (for squad chat functionality)
   * `hate-nametagv2` (for mask system integration)
5. **Permissions**: Set up ACE permissions for admin commands
6. **Restart**: Restart your server and test the system

### Quick Configuration

```lua
-- Essential settings to get started
Config.Framework.Type = 'qbcore' -- or 'esx'
Config.General.UseRPName = true -- Use RP names or Steam names
Config.SquadMode.Enabled = true -- Enable squad chat
Config.GlobalOOC.Enabled = true -- Enable global OOC
```

### Player Controls

* **Normal Chat**: Type and press Enter
* **Squad Toggle**: `Shift + T` to toggle between Normal → Squad → Global OOC
* **Commands**: Type `/` to see available commands with auto-complete

***

## Framework Configuration

```lua
Config.Framework = {
    Type = 'qbcore', -- 'esx' or 'qbcore'
    QBCoreName = 'qb-core', -- change if you use a different name
    ESXEvent = 'esx:getSharedObject', -- change if you use a different event name
}
```

### Settings:

* **Type**: Choose between `'esx'` or `'qbcore'`
* **QBCoreName**: Name of your QBCore export (if using QBCore)
* **ESXEvent**: ESX shared object event name (if using ESX)

***

## General Settings

```lua
Config.General = {
    Masked = true, -- only make this true if you are using hate-nametagv2
    TextRPMessage = true, -- if you want chatting like textrp make this true
    EnableChatSuggestions = true, -- Enable/disable chat command suggestions
    TextDisplayTime = 1350, -- How long text displays above head (ms)
    MaskCheckInterval = 3000, -- How often to check mask status (ms)
    UseRPName = true, -- if false uses player's nickname, if true uses RP name
}
```

### Settings:

* **Masked**: Enable mask system integration (requires hate-nametagv2)
* **TextRPMessage**: Enable 3D text above player heads for roleplay commands
* **EnableChatSuggestions**: Show command suggestions in chat
* **TextDisplayTime**: Duration text appears above heads (milliseconds)
* **MaskCheckInterval**: How often to check player mask status (milliseconds)
* **UseRPName**:
  * `true`: Use roleplay character name (firstname + lastname)
  * `false`: Use player's Steam/FiveM nickname

***

## Squad Mode Settings

```lua
Config.SquadMode = {
    Enabled = true, -- Enable squad mode toggle with Shift+T
    ToggleKey = 'T', -- Key to press with Shift (T = Shift+T)
    UseHateSquad = true, -- Use hate-squad system instead of job-based
    HateSquadResource = 'hate-squad', -- Name of the hate-squad resource
    IndicatorText = '[SQUAD CHAT]', -- Text shown in chat when in squad mode
    IndicatorColor = '#4CAF50', -- Color of the squad mode indicator (green for squad)
    EnableNotification = true, -- Show notification when toggling modes
    RequireSquadMembership = true, -- Only allow squad members to use squad chat
}
```

### Features:

* **Toggle Key**: Press `Shift + T` to toggle between normal chat and squad chat
* **Hate-Squad Integration**: Works with the hate-squad resource for squad management
* **Visual Indicators**: Shows `[SQUAD CHAT]` indicator when in squad mode
* **Notifications**: Displays notification when switching modes

***

## Global OOC Settings

```lua
Config.GlobalOOC = {
    Enabled = true, -- Enable global OOC mode
    IndicatorText = '[GLOBAL OOC]', -- Text shown in chat when in global OOC mode
    IndicatorColor = '#6be6ffff', -- Color of the global OOC indicator
    MessageColor = '#6be6ffff', -- Color of the global OOC messages
    EnableNotification = true, -- Show notification when toggling to global OOC
    RequirePermission = false, -- Set to true if you want to restrict global OOC to certain players
    AllowedJobs = {}, -- Jobs that can use global OOC (only if RequirePermission is true)
    Prefix = '[Global OOC]', -- Prefix shown in the actual message
}
```

### Features:

* **Global Chat**: Out-of-character chat visible to all players
* **Permission System**: Optionally restrict to specific jobs
* **Toggle System**: Press `Shift + T` multiple times to cycle: Normal → Squad → Global OOC

***

## Spam Protection

```lua
Config.SpamProtection = {
    Enabled = false, -- Enable spam protection
    MaxAttempts = 5, -- Maximum message attempts before blocking
    CooldownTime = 5000, -- Cooldown time in milliseconds
    BlockDuration = 30000, -- How long to block user (ms)
}
```

### Protection Features:

* **Rate Limiting**: Limit messages per time window
* **Temporary Blocking**: Block spammers for specified duration
* **Configurable Thresholds**: Customize detection sensitivity

***

## Chat Message Settings

```lua
Config.ChatMessage = {
    Enabled = true, -- Enable chat message handling
    RequireMessage = true, -- Require non-empty messages
    TrimWhitespace = true, -- Auto-trim whitespace from messages
    MinMessageLength = 1, -- Minimum message length
    MaxMessageLength = 255, -- Maximum message length
    BlockEmptyMessages = true, -- Block messages with only whitespace
    LogToDiscord = true, -- Log normal chat to Discord
    ShowSaysPrefix = true, -- Show "PlayerName says:" prefix
    DefaultChatColor = "255,255,255", -- Default chat color (R,G,B)
    SaysDistance = 15.0, -- Distance for normal chat
    
    -- Advanced Filtering
    WordFilter = {
        Enabled = true, -- Enable word filtering
        BlockedWords = {'badword1', 'badword2'}, -- List of blocked words
        ReplaceChar = "*", -- Character to replace blocked words
        CaseSensitive = false, -- Case sensitive filtering
        WholeWordOnly = false, -- Only block whole words
    },
    
    -- Rate Limiting (per player)
    RateLimit = {
        Enabled = false, -- Enable rate limiting
        MaxMessages = 10, -- Max messages per time window
        TimeWindow = 60, -- Time window in seconds
        PenaltyTime = 30, -- Penalty time in seconds
    }
}
```

### Features:

* **Message Validation**: Length limits, empty message blocking
* **Word Filtering**: Configurable profanity filter
* **Rate Limiting**: Prevent chat spam per player
* **Discord Logging**: Optional chat logging to Discord

***

## 3D Text Display Settings

```lua
Config.Text3D = {
    Font = 0, -- Text font (0-8)
    ScaleDistance = 2, -- Distance scale factor
    FOVMultiplier = 80, -- Field of view multiplier
    TextScale = 0.35, -- Base text scale
    LineSpacing = 0.12, -- Spacing between multiple lines
    MaxLines = 5, -- Maximum lines of text to display
    DropShadow = true, -- Enable drop shadow
    TextOutline = true, -- Enable text outline
    EdgeSettings = {
        enabled = true,
        alpha = 150
    },
    DropShadowSettings = {
        distance = 0,
        r = 0, g = 0, b = 0,
        alpha = 255
    }
}
```

### Visual Features:

* **Customizable Fonts**: Choose from 9 different text fonts
* **Text Effects**: Drop shadows, outlines, and edge enhancement
* **Multi-line Support**: Display multiple lines with custom spacing
* **Distance Scaling**: Text size adjusts based on distance

***

## Proximity Settings

```lua
Config.Proximity = {
    DefaultDistance = 15.0, -- Default distance for proximity chat
    MaxDistance = 30.0, -- Maximum distance for any command
    DrawOnHeadDistance = 20, -- Distance threshold for drawing text above head
}
```

### Distance System:

* **Proximity Chat**: Messages only visible within specified distance
* **Visual Range**: 3D text appears within draw distance
* **Configurable Ranges**: Different distances for different command types

***

## Discord Webhook Settings

```lua
Config.Discord = {
    Enabled = false,
    ReportWebhook = '', -- Report log webhook URL
    AdminWebhook = '', -- Admin actions webhook URL
    ChatWebhook = '', -- Chat logs webhook URL
    LeoWebhook = '', -- LEO chat webhook URL
    ServerName = 'Your Server Name',
    Colors = {
        Report = 16711680, -- Red
        Admin = 255, -- Blue  
        Chat = 65280, -- Green
        LeoChat = 3447003, -- Blue
    },
    LogTypes = {
        Reports = true, -- Log report actions
        Commands = true, -- Log admin commands
        LeoChat = true, -- Log LEO chat messages
        ChatCommands = true, -- Log roleplay chat commands
    }
}
```

### Logging Features:

* **Multiple Webhooks**: Separate webhooks for different log types
* **Colored Embeds**: Different colors for different message types
* **Selective Logging**: Choose what to log and what to ignore
* **Rich Formatting**: Detailed embed messages with player information

***

## Report System Settings

```lua
Config.ReportSystem = {
    Enabled = true,
    MaxReports = 50, -- Maximum active reports
    AutoClose = true, -- Auto close reports after time
    AutoCloseTime = 3600, -- Auto close time in seconds (1 hour)
    RequireReason = true, -- Require reason for closing reports
    NotifyAdmins = true, -- Notify all admins when new report is created
}
```

### Report Commands:

* `/report send [message]` - Submit a new report
* `/report list` - List all active reports (admin)
* `/report info [id]` - Get detailed report information
* `/report take [id]` - Take a report (admin)
* `/report answer [id] [message]` - Respond to a report
* `/report close [id] [reason]` - Close a report

***

## Money & Economy Settings

```lua
Config.Economy = {
    AdvertCost = 100, -- Cost for advert command
    AdvertCooldown = 30, -- Cooldown in minutes
    CurrencyType = 'cash', -- 'cash' or 'bank'
    AdvertLocation = { x = -283.24, y = -607.16, z = 33.55 }, -- Required location for adverts
    AdvertDrawText = {
        Enabled = true,
        Text = '/advert! (($100))',
        Color = { r = 255, g = 127, b = 80, a = 255 },
    },
    AdvertBlip = {
        Enabled = true,
        Sprite = 564,
        Color = 44,
        Scale = 0.8,
        Name = 'Advert Bölgesi'
    }
}
```

### Economic Features:

* **Paid Commands**: Charge money for certain commands like `/advert`
* **Location Restrictions**: Require players to be at specific locations
* **Visual Markers**: Blips and markers for special locations
* **Cooldown System**: Prevent command spam with time restrictions

***

## Animation Settings

```lua
Config.Animations = {
    Enabled = true,
    DiceAnimation = {
        Dict = "gestures@m@standing@casual",
        Anim = "gesture_point",
        Duration = 2400
    },
    RadioAnimation = {
        Dict = "random@arrests",
        Anim = "generic_radio_chatter",
        Duration = 3000
    }
}
```

### Supported Animations:

* **Dice Rolling**: Plays animation when using `/roll` command
* **Coin Flipping**: Animation for `/flipcoin` command
* **Radio Usage**: Animation for LEO chat and radio commands
* **Customizable**: Change animation dictionaries, names, and durations

***

## Command Configuration

The system includes numerous built-in commands organized by categories:

### Roleplay Commands

* `/me [action]` - Perform an action (shows above head and in chat)
* `/do [description]` - Describe something happening
* `/ame [action]` - Action shown only above head
* `/amy [description]` - Description shown only above head

### Communication Commands

* `/l [message]` - Low voice (5m range)
* `/s [message]` - Shout (25m range)
* `/w [message]` - Whisper (2m range)
* `/b [message]` - Local OOC (15m range)
* `/ooc [message]` - Out of character chat

### Special Commands

* `/advert [message]` - Server-wide advertisement (costs money)
* `/pm [playerID] [message]` - Private message
* `/roll [dice] [sides]` - Roll dice
* `/flipcoin` - Flip a coin

### Admin Commands

* `/ann [message]` - Server announcement
* `/event [message]` - Event announcement

### Information Commands

* `/money` - Check your money
* `/charinfo` - Character information

Each command can be individually:

* **Enabled/Disabled**: Turn commands on or off
* **Customized**: Change colors, distances, prefixes
* **Restricted**: Require specific jobs or permissions
* **Animated**: Add custom animations

***

## Chat Mode Toggle System

The system supports three chat modes that players can cycle through:

1. **Normal Chat Mode**: Standard proximity chat
2. **Squad Chat Mode**: Private chat with squad members (requires hate-squad resource)
3. **Global OOC Mode**: Server-wide out-of-character chat

### How to Toggle:

* Press `Shift + T` to cycle through modes
* Visual indicators show current mode
* Notifications inform players of mode changes

***

## Integration Requirements

### Required Resources:

* **Framework**: ESX or QBCore
* **Optional**: hate-squad (for squad chat functionality)
* **Optional**: hate-nametagv2 (for mask system)

### Permissions:

The system uses FiveM's built-in ACE permission system. Configure permissions in your `server.cfg`:

```
add_ace group.admin command.ann allow
add_ace group.admin command.event allow
add_ace group.moderator command.report allow
```

***

## Troubleshooting

### Common Issues:

1. **Names not showing correctly**:
   * Check `Config.General.UseRPName` setting
   * Verify framework configuration is correct
2. **Squad chat not working**:
   * Ensure hate-squad resource is running
   * Check `Config.SquadMode.HateSquadResource` name
3. **Commands not responding**:
   * Verify ACE permissions are set correctly
   * Check console for error messages
4. **3D text not appearing**:
   * Check `Config.General.TextRPMessage` is enabled
   * Verify proximity distance settings

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://hate-development.gitbook.io/hate-development-docs/dayz-chat.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.
