Oxide StudiosOxide Studios

Configuration Reference

Complete configuration options for Oxide Chat.

Table of Contents


Configuration Files

Configuration is split across multiple files in the config/ folder:

FilePurpose
main.luaCore settings, UI, proximity, chat types
commands.luaCommand definitions with formatting
blacklist.luaCommands to hide from suggestions

General Settings

Config.MaxMessages

Maximum messages kept in chat history.

Config.MaxMessages = 100

Config.MaxMessageLength

Maximum characters per message.

Config.MaxMessageLength = 256

Config.MessageFadeTime

Time in milliseconds before messages fade. Set to 0 to disable fading.

Config.MessageFadeTime = 10000  -- 10 seconds

Config.InputHistorySize

Number of previous inputs to remember for arrow-key navigation.

Config.InputHistorySize = 50

Keybinds

Config.OpenKey

Key to open chat input.

Config.OpenKey = 'T'

Config.CloseKey

Key to close chat input.

Config.CloseKey = 'Escape'

Note: Keybinds can be changed by players in FiveM settings under "Key Bindings".


UI Settings

Config.UI

Basic UI configuration.

Config.UI = {
    position = 'left',   -- 'left' or 'right' (legacy, use DefaultSettings)
    width = 550,         -- Chat width in pixels
    height = 320,        -- Chat height in pixels
}

Note: These are default values. Players can customize via the settings panel.


Proximity Settings

Config.ProximityDistance

Distance in meters for each proximity chat type.

Config.ProximityDistance = {
    me = 15.0,           -- /me action range
    ['do'] = 15.0,       -- /do description range
    whisper = 3.0,       -- /whisper range (very close)
    shout = 50.0,        -- /shout range (long distance)
    local_ooc = 20.0,    -- /looc range
}

Choosing Ranges

RangeUse Case
3-5mIntimate/whisper
10-20mNormal conversation
30-50mShouting/yelling
50m+Very loud events

Line of Sight Settings

Config.RequireLOS

Whether each chat type requires line of sight.

Config.RequireLOS = {
    me = true,           -- /me requires seeing the player
    ['do'] = true,       -- /do requires seeing the player
    whisper = false,     -- Whisper works through walls
    shout = false,       -- Shout works through walls
    local_ooc = false,   -- LOOC works through walls
}

How LOS Works

  • Uses raycasting from eye level to eye level
  • Players in the same vehicle are always visible
  • Client-side check for immersion (server handles security via distance)

Chat Type Styling

Config.ChatTypes

Styling for each message type.

Config.ChatTypes = {
    default = {
        color = '#F4F5F7',
    },
    system = {
        prefix = 'SYSTEM',
        color = '#5F6670',
    },
    announcement = {
        prefix = 'ANNOUNCEMENT',
        color = '#9B2C2C',
    },
    ooc = {
        prefix = 'OOC',
        color = '#C47A2C',
    },
    me = {
        color = '#F4F5F7',
        italic = true,
    },
    ['do'] = {
        color = '#5F6670',
        italic = true,
    },
    whisper = {
        prefix = 'WHISPER',
        color = '#C47A2C',
    },
    shout = {
        prefix = 'SHOUT',
        color = '#9B2C2C',
    },
    -- Job channels
    police = {
        prefix = 'LSPD',
        color = '#3b82f6',
    },
    ambulance = {
        prefix = 'EMS',
        color = '#ef4444',
    },
    mechanic = {
        prefix = 'MECHANIC',
        color = '#f97316',
    },
}

Chat Type Properties

PropertyTypeDescription
colorstringHex color code
prefixstringPrefix shown before message
italicbooleanWhether to italicize message

Adding Custom Types

Config.ChatTypes.taxi = {
    prefix = 'TAXI',
    color = '#FFFF00',
    italic = false,
}

Cooldowns

Config.Cooldowns

Rate limiting in milliseconds.

Config.Cooldowns = {
    ooc = 5000,          -- 5 seconds between OOC messages
    announcement = 30000, -- 30 seconds between announcements
    chat = 1000,         -- 1 second between regular messages
    pm = 1000,           -- 1 second between private messages
    proximity = 1500,    -- 1.5 seconds between /me, /do, etc.
}

Cooldown Behavior

  • Cooldowns are enforced server-side
  • Players receive notification with remaining time
  • Console commands bypass cooldowns

Default Player Settings

Config.DefaultSettings

Default values for player-customizable settings. These are used when no saved settings exist.

Config.DefaultSettings = {
    -- Position
    position = 'top-left',        -- 3x3 grid or 'custom'
    gradientDirection = '90deg',  -- Gradient angle for custom position
    customX = 24,                 -- Custom X position (px)
    customY = 24,                 -- Custom Y position (px)

    -- General
    fontSize = 14,                -- Font size (12-20)
    fadeTime = 10,                -- Fade time in seconds (0 = never)
    timestampMode = 'hover',      -- 'always', 'hover', 'never'
    suggestionsPosition = 'top',  -- 'top' or 'bottom'

    -- Per-type visibility and colors
    chatTypes = {
        ooc = { visible = true, color = '#C47A2C' },
        me = { visible = true, color = '#F4F5F7' },
        ['do'] = { visible = true, color = '#5F6670' },
        system = { visible = true, color = '#5F6670' },
        whisper = { visible = true, color = '#C47A2C' },
        shout = { visible = true, color = '#9B2C2C' },
        announcement = { visible = true, color = '#9B2C2C' },
        police = { visible = true, color = '#3b82f6' },
        ambulance = { visible = true, color = '#ef4444' },
        mechanic = { visible = true, color = '#f97316' },
    },

    -- Appearance
    appearance = {
        backgroundOpacity = 75,        -- 0-100%
        blurIntensity = 8,             -- 0-20px
        chatWidth = 480,               -- 320-640px
        animationsEnabled = true,      -- Message animations
        messageDensity = 'comfortable', -- 'compact', 'comfortable', 'spacious'
    },

    _version = 2,  -- Settings schema version
}

Position Options

ValueLocation
top-leftTop left corner
top-middleTop center
top-rightTop right corner
leftMiddle left
centerScreen center
rightMiddle right
bottom-leftBottom left corner
bottom-middleBottom center
bottom-rightBottom right corner
customUses customX/customY values

Timestamp Modes

ValueDescription
alwaysAlways show timestamps
hoverShow on message hover
neverNever show timestamps

Message Density

ValueVertical Padding
compactMinimal spacing
comfortableDefault spacing
spaciousExtra spacing

Command Blacklist

Config.BlacklistedPrefixes

Hide commands starting with these prefixes from suggestions.

Config.BlacklistedPrefixes = {
    ['_'] = true,      -- Internal commands
    ['dev'] = true,    -- Developer commands
    ['debug'] = true,  -- Debug commands
    ['test'] = true,   -- Test commands
}

Config.BlacklistedCommands

Hide specific commands from suggestions.

Config.BlacklistedCommands = {
    'toggleChat',   -- Internal toggle
    'chatResult',   -- NUI callback
}

Config.IsBlacklisted()

Helper function to check if a command is blacklisted.

if Config.IsBlacklisted('devCommand') then
    -- Command won't appear in suggestions
end

Debug Mode

Config.Debug

Enable debug logging and features.

Config.Debug = false

When Enabled

  • Server print messages appear in chat
  • Additional console logging
  • Debug commands available

Production

Always set to false in production:

Config.Debug = false

Complete Default Configuration

config/main.lua

Config = Config or {}

-- General Settings
Config.MaxMessages = 100
Config.MaxMessageLength = 256
Config.MessageFadeTime = 10000
Config.InputHistorySize = 50

-- Keybinds
Config.OpenKey = 'T'
Config.CloseKey = 'Escape'

-- UI Settings
Config.UI = {
    position = 'left',
    width = 550,
    height = 320,
}

-- Proximity Settings
Config.ProximityDistance = {
    me = 15.0,
    ['do'] = 15.0,
    whisper = 3.0,
    shout = 50.0,
    local_ooc = 20.0,
}

-- Line of Sight
Config.RequireLOS = {
    me = true,
    ['do'] = true,
    whisper = false,
    shout = false,
    local_ooc = false,
}

-- Chat Type Styling
Config.ChatTypes = {
    default = { color = '#F4F5F7' },
    system = { prefix = 'SYSTEM', color = '#5F6670' },
    announcement = { prefix = 'ANNOUNCEMENT', color = '#9B2C2C' },
    ooc = { prefix = 'OOC', color = '#C47A2C' },
    me = { color = '#F4F5F7', italic = true },
    ['do'] = { color = '#5F6670', italic = true },
    whisper = { prefix = 'WHISPER', color = '#C47A2C' },
    shout = { prefix = 'SHOUT', color = '#9B2C2C' },
    police = { prefix = 'LSPD', color = '#3b82f6' },
    ambulance = { prefix = 'EMS', color = '#ef4444' },
    mechanic = { prefix = 'MECHANIC', color = '#f97316' },
}

-- Cooldowns (milliseconds)
Config.Cooldowns = {
    ooc = 5000,
    announcement = 30000,
    chat = 1000,
    pm = 1000,
    proximity = 1500,
}

-- Debug Mode
Config.Debug = false