actually i don't get what you really want but maybe this will work with you
function chatbox(text, msgtype)
local root = getRootElement()
local account = getAccountName(getPlayerAccount(source))
local name = getPlayerName(source)
local color = string.format("#%02X%02X%02X", getPlayerNametagColor(source))
if (msgtype == 0) then
cancelEvent()
if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then
outputChatBox("#990000|OWNER| "..color.."" .. name .. ":#f7fc00 " .. text, root, 255,255,255, true)
outputServerLog("CHAT: #990000~|OWNER|~ " .. name .. ": " .. text)
elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then
outputChatBox("#000000~SuperModerator~ "..color.."" .. name ..":#FFFFFF " .. text, root, 255,255,255, true)
outputServerLog("CHAT: #00a2fc~SuperModerator~" .. name .. ": " .. text)
elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then
outputChatBox("#3366ff~Moderator~ "..color.."" .. name .. ":#FFFFFF " .. text, root, 255,255,255, true)
outputServerLog("CHAT: #00ff00~Moderator~ " .. name .. ": " .. text)
elseif isObjectInACLGroup("user." .. account, aclGetGroup("Trainee")) then
outputChatBox(" #FFFF00~Trainee~ "..color.."" .. name .. ":#FFFFFF " .. text, root, 255,255,255, true)
outputServerLog("CHAT: #FFFF00~Vip~" .. name .. ": " .. text)
elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then
outputChatBox(" #00a2fc~|OWNER|~ "..color.."" .. name .. ":#f7fc00 " .. text, root, 255,255,255, true)
outputServerLog("CHAT: #00a2fc~|OWNER|~" .. name .. ": " .. text)
end
elseif (msgtype == 2) then
end
end
addEventHandler("onPlayerChat", root, chatbox)