Yeah I tried editing the other lines but they didn’t seem to work but I probably did something wrong.
TriggerEvent('chatMessage', source, #outMessage.args > 1 and outMessage.args[1] or '', outMessage.args[#outMessage.args])
if not WasEventCanceled() then
if type(routingTarget) ~= 'table' then
TriggerClientEvent('chat:addMessage', routingTarget, outMessage)
else
for _, id in ipairs(routingTarget) do
TriggerClientEvent('chat:addMessage', id, outMessage)
end
end
end
if not fromConsole then
print(author .. '^7' .. (modes[mode] and (' (' .. modes[mode].displayName .. ')') or '') .. ': ' .. message .. '^7')
end
end
I have found a chat resource that uses this code (some things I have added):
AddEventHandler('_chat:messageEntered', function(author, color, message)
if not message or not author then
return
end
TriggerEvent('chatMessage', source, author, message)
if not WasEventCanceled() then
TriggerClientEvent('chatMessage', -1, "OOC | " .. author, { 128, 128, 128 }, message)
end
print(author .. '(' .. source .. ')', '^7: ' .. message .. '^7')
end)
However I believe this can solve my issue but I can’t seem to make it work. When the message gets printed it shows the server ID but when I type in chat it still shows:
Name: (msg)
I have tried adding '(' .. source .. ')', to this line:
But still nothing, if anyone knows the correct way to display serverID please let me know. Also If anyone knows my the "OOC | " is not working either please let me know.