CodeM Supreme Chat
On this page3
Its display name is built in an encrypted server/functions.lua from
Config.PlayerName ('game' | 'fivem'), and its client exports
(GetSettings, UpdateSettings, GetRestrictedChannels) are about settings,
not names. Its built-in commands cannot be changed.
What can be done: chat:addMessage accepts showPlayerData = {id, name} for
messages a resource sends itself. So any command you write can carry a
different name for every recipient.
We do not ship or modify their code.
A per-recipient /me through Supreme Chat
-- your own resource, server side
RegisterCommand('me', function(src, args)
local text = table.concat(args, ' ')
if text == '' then return end
local origin = GetEntityCoords(GetPlayerPed(src))
for _, id in ipairs(GetPlayers()) do
local viewer = tonumber(id)
if #(GetEntityCoords(GetPlayerPed(viewer)) - origin) <= 20.0 then
local name = (viewer == src) and 'You'
or exports['5code-recognition']:GetRecognitionLabel(viewer, src)
or 'Stranger'
TriggerClientEvent('chat:addMessage', viewer, {
template = '<div class="chat-message me"><b>{0}</b> {1}</div>',
args = { name, text },
showPlayerData = { id = src, name = name },
})
end
end
end, false)Every listener gets their own name, so nobody sees a name their character has
not earned.
Masks
Supreme Chat tracks mask anonymity with its own server event, which its own client sends on every message:
codem-supreme-chat:server:UpdateMaskState(isWearingMask)Do not fire that event from our bridge: it is a client-authored signal on their
side and ours would be overwritten by their next message. If you want their mask
state to follow our tiered face coverage, ask them to call
exports['5code-recognition']:IsFaceHidden(source) on the server instead.
What is not possible today
Built-in commands (/ooc, /twt, channels, …) render the name from their
encrypted code. Until CodeM adds a hook, recognition-driven names are limited to
messages your own resource sends.