I made the database that this game mode needs and it seems to work. But I need help with the lines “User” and “Admin”. How can I set the colors white, black and gray?
– Hooking into chat messages to insert admin tags.
AddEventHandler(‘chatMessageEntered’, function(name, color, message)
CancelEvent()
local tag = "^whiteUser ^black| ^gray"
if(Users[source] ~= nil)then
if(tonumber(Users[source].admin) > 0)then
tag = "^redAdmin ^black| ^gray"
end
end
TriggerEvent('chatMessage', source, tag .. GetPlayerName(source), message)
TriggerClientEvent('chatMessage', -1, tag .. GetPlayerName(source), {0, 0x99, 255}, message)
print(GetPlayerName(source) .. ': ' .. message)
end)
I tried to set colors like this: local tag = “^7User ^0| ^9” but they do not work