Chat Channels
Channels organize messages and control who can send/receive them. Think of Discord channels but for FiveM.
Creating a Channel
Edit config/channels.lua:
Config.Channels = {
{
id = 'all', -- Unique identifier
label = 'ALL', -- Display name
color = '#b9bbbe', -- Channel indicator color
participants = {
read = { 'ALL' }, -- Who can READ
write = { 'ALL' }, -- Who can WRITE
},
area = false, -- Area-restricted?
},
-- Add more channels...
}
Participant Types
Global Access
participants = {
read = { 'ALL' },
write = { 'ALL' },
}
Job-Based
participants = {
read = { { type = 'job', value = 'police', minGrade = 0 } },
write = { { type = 'job', value = 'police', minGrade = 1 } },
}
Players in the "police" job (grade 0+) can read, but only grade 1+ can write.
Gang-Based
participants = {
read = { { type = 'gang', value = 'ballas', minGrade = 0 } },
write = { { type = 'gang', value = 'ballas', minGrade = 0 } },
}
Specific Players
participants = {
read = {
{ type = 'id', value = 123 }, -- Player ID 123
{ type = 'id', value = 456 },
},
write = { { type = 'id', value = 123 } },
}
ACE Permissions
participants = {
read = { { type = 'ace', value = 'group.admin' } },
write = { { type = 'ace', value = 'group.admin' } },
}
Admin Only
participants = {
read = { { type = 'admin' } },
write = { { type = 'admin' } },
}
Area-Restricted Channels
Limit messages to a geographic area:
{
id = 'dispatch',
label = 'Dispatch',
color = '#e74c3c',
participants = {
read = { { type = 'job', value = 'police' } },
write = { { type = 'job', value = 'police' } },
},
area = true, -- Enable area restriction
areaRadius = 50.0, -- Metres (default 50)
}
Receivers only see messages from senders within areaRadius metres.
Full Example Setup
Config.Channels = {
-- Global channels
{
id = 'all',
label = 'GLOBAL',
color = '#b9bbbe',
participants = {
read = { 'ALL' },
write = { 'ALL' },
},
area = false,
},
-- Twitter/Social
{
id = 'twitter',
label = 'Twitter',
color = '#1DA1F2',
participants = {
read = { 'ALL' },
write = { 'ALL' },
},
area = false,
},
-- Police Radio
{
id = 'police',
label = 'Police Radio',
color = '#3498db',
participants = {
read = { { type = 'job', value = 'police', minGrade = 0 } },
write = { { type = 'job', value = 'police', minGrade = 0 } },
},
area = false,
},
-- Medical Channel
{
id = 'medical',
label = 'Medical',
color = '#e74c3c',
participants = {
read = { { type = 'job', value = 'ambulance', minGrade = 0 } },
write = { { type = 'job', value = 'ambulance', minGrade = 0 } },
},
area = true,
areaRadius = 50.0,
},
-- Admin Channel
{
id = 'admin',
label = 'Admin',
color = '#e74c3c',
participants = {
read = { { type = 'admin' } },
write = { { type = 'admin' } },
},
area = false,
},
-- VIP Lounge
{
id = 'vip',
label = 'VIP',
color = '#f39c12',
participants = {
read = { { type = 'ace', value = 'group.vip' } },
write = { { type = 'ace', value = 'group.vip' } },
},
area = false,
},
}
Channel Indicators
Players see channel indicators in the chat:
- Small colored dot next to timestamp
- Channel label on hover
- Only visible if user has permission to access
Switching Channels
Players can switch channels via:
- Chat UI channel selector (top left)
- Commands tied to channels (e.g.,
/twitter,/adminchat)
Assigning Commands to Channels
Link a command to a channel:
Config.Commands.twitter = {
enabled = true,
command = "twitter",
channel = "twitter", -- ← Channel assignment
description = "Post a tweet",
author = '{Framework.Functions.GetPlayerName}',
}