function playerChat(message, messageType)
if messageType == 2 then
cancelEvent()
local acc = getPlayerAccount(source)
if not isGuestAccount(acc) then
local color = getAccountData(acc, "chatc")
local VIP = getElementData(source, "Vip")
local team = getPlayerTeam(source)
local r, g, b = getTeamColor(team)
local name = getPlayerName(source)
for i, player in ipairs(getPlayersInTeam(team)) do
if color and VIP then
outputChatBox("(TEAM): "..name..": "..color..message, player, r, g, b, true)
else
outputChatBox("(TEAM): "..name..": #FFFFFF"..message, player, r, g, b, true)
end
end
outputServerLog("CHAT: "..name..": "..message)
end
end
end
addEventHandler("onPlayerChat", root, playerChat)