Skip to content

Configuration

Every option of Cuxial Chat explained: config, channels and the command palette.

Everything you can adjust lives in three files: shared/config.lua for behaviour, data/channels.lua for the channels and data/commands.lua for the command palette. Restart the resource after any change.

General ​

OptionTypeDefaultWhat it does
debugbooleanfalsePrints traces to the console. Also enabled by setting the convar cuxial_chat_debug to 1.
proximitynumber12.0Radius in metres of the proximity channels: IC, OOC, ME, DO, dice rolls and images.
persistSettingsbooleantruetrue saves each player's settings in the database, tied to the character. false keeps them only on the player's PC.

Interface · ui ​

OptionTypeDefaultWhat it does
accentstring (hex)configurableAccent colour of the interface.
openKeystring'T'Default key that opens the chat. Each player can rebind it in the GTA key settings.
maxMessagesnumber400Messages the interface keeps in memory. From 21 to 2000.

Roleplay actions · actions ​

OptionTypeDefaultWhat it does
displaystring'head'Where /me, /do and dice rolls are shown for players who have not chosen it themselves. 'both' = chat and above the head, 'head' = above the head only, 'chat' = chat only. Any other value works as 'both'.

This is only the server default. Every player can pick their own value in the chat settings, and their choice wins.

Bubbles · bubble ​

OptionTypeDefaultWhat it does
distancenumber25.0Metres beyond which a bubble is not drawn. Also the range of the "is typing" indicator.
msnumber6000Lifetime of a bubble, in milliseconds.
ticknumber50Milliseconds between refreshes while bubbles are visible. Lower is smoother and costs more.
idlenumber300Milliseconds between checks when there is nothing to draw.
typingMsnumber8000Milliseconds until the "is typing" indicator expires.
typingSelfbooleantruetrue shows your own typing indicator. false shows it only to others.
stacknumber3Maximum bubbles stacked per player.

Anonymous names · anonymous ​

Hides the player's name while they wear a mask.

OptionTypeDefaultWhat it does
enabledbooleantruetrue hides the name with a mask on. false always shows the name.
anyMaskbooleantruetrue accepts any mask. false accepts only the ones listed in masks.
masksnumber[]{}Mask numbers (drawable) that hide the name. Only used when anyMask = false.
labelstring'anonymous_label'Name shown instead. A locale key or a literal text.
channelstableme, do, dice, icChannels where the name is hidden: true hides it, false shows it.

Only the proximity channels can hide the name: ic, ooc, me, do and dice. Private messages and the organization channel always show the real name.

Organization channel · gchat ​

A channel shared by all organizations. The public variant is also read by the police.

OptionTypeDefaultWhat it does
enabledbooleantruefalse removes both commands.
commandstring'gchat'Command of the channel between organizations.
publicCommandstring'gchatp'Command of the variant the police can also read.
policeJobsstring[]{ 'leo' }List of police jobs. Add the ones on your server. Each entry matches a job type or a job name.
requireDutybooleantruetrue = police read and write only while on duty. false = always.
policeCanWritebooleantruetrue = police can write in the public channel. false = read only.
fallbackColorstring (hex)'#8b5cf6'Colour of an organization without its own colour.
policeColorstring (hex)'#4f8cff'Colour of police messages and of the "Open" tag.
policeLabelstring'gchat_police_label'Police tag. A locale key or a literal text.

An organization is the player's gang, as reported by cuxial_bridge. Anything the police write is always sent as public.

Images · images ​

OptionTypeDefaultWhat it does
enabledbooleanfalsetrue registers the image command.
commandstring'img'Command used to send an image.
channelstring'ooc'Channel the image is posted in. An id from data/channels.lua.
hostsstring[]i.imgur.com, cdn.discordapp.com, media.discordapp.net, media.tenor.comAllowed domains. Any other link is rejected.
extensionsstring[]png, jpg, jpeg, gif, webpAllowed file extensions, in lowercase.
perMinutenumber3Images per player per minute.

Only https links of up to 400 characters are accepted, and the link must end in the image file. Images always go to nearby players, whatever the channel.

Logs · logs ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse stores nothing.
channelstableooc, ic, pm, gchatChannels that are logged. An empty table logs every channel.
databasebooleantruetrue saves to the table cuxial_chat_logs. false sends to Discord only.
keepDaysnumber14Days the database keeps the logs. 0 keeps them forever. Old rows are removed when the resource starts.
discord.convarstring'cuxial_chat_webhook'Name of the server.cfg convar that holds the webhook URL. Empty convar = no Discord.
discord.batchnumber15Queued messages that trigger a webhook request at once.
discord.flushMsnumber20000Milliseconds between writes. Applies to the webhook and to the database.
discord.usernamestring'Chat'Name the webhook posts as.

Channels · data/channels.lua ​

Each entry is a channel: its tab, its colour and the command it writes with.

FieldTypeWhat it does
idstringInternal identifier. Used by the config and by the exports.
labelstringLocale key of the name shown on the tab.
voicestringLocale key of the caption shown in the bubble.
colorstring (hex)Colour of the channel.
tabbooleantrue gives the channel its own tab. false shows it only in the general view.
ordernumberPosition of the tab.
iconstringBubble icon: user, eye, dice, lock, radio, message, shield or megaphone.
commandstringCommand of the channel. Players can write directly in a tab only if its channel has one.
soundbooleantrue plays a sound on incoming messages.
bubblebooleantrue shows its messages above the author's head.
mutablebooleanfalse stops players from muting the channel in their settings.

Channels included: ic, ooc, me, do, pm, dice, gchat, sancion and system.

Do not remove ic or system. Plain messages fall back to ic and messages from other resources fall back to system.

Command palette · data/commands.lua ​

The list the chat suggests when a player types /. It only describes the commands; it does not create them.

FieldTypeWhat it does
namestringCommand without the slash.
helpstringLocale key of the description.
channelstringChannel the command belongs to. It sets the colour of the suggestion.
paramstableArguments shown, each with name and an optional optional = true.

Commands announced by other resources are added to this list on their own.

Texts ​

All texts are in locales/en.json and locales/es.json. The language follows the ox:locale convar.

Common changes ​

Show actions in the chat as well ​

shared/config.lua
lua
actions = {
    display = 'both',
},

Hide names only behind specific masks ​

shared/config.lua
lua
anonymous = {
    enabled = true,
    anyMask = false,
    masks = { 51, 52, 111 },
    label = 'anonymous_label',
    channels = {
        me = true,
        ['do'] = true,
        dice = true,
        ic = false,
    },
},

Enable images ​

shared/config.lua
lua
images = {
    enabled = true,
    command = 'img',
    channel = 'ooc',
    hosts = { 'i.imgur.com' },
    extensions = { 'png', 'jpg', 'jpeg', 'gif', 'webp' },
    perMinute = 3,
},

Rename the organization commands ​

shared/config.lua
lua
gchat = {
    command = 'org',
    publicCommand = 'orgp',
    -- keep the rest of the block as it is
},

After renaming, update the gchat and gchatp entries in data/commands.lua so the palette shows the new names.

Log every channel to Discord only ​

shared/config.lua
lua
logs = {
    enabled = true,
    channels = {},
    database = false,
    keepDays = 14,
    discord = {
        convar = 'cuxial_chat_webhook',
        batch = 15,
        flushMs = 20000,
        username = 'Chat',
    },
},

© Cuxial