CreateChat "!tag" "" (0)[[
	if USER[id]["tag"] then
		msgc2(id, "Tag deactivated", 255, 0, 0)
		USER[id]["tag"] = nil
	else
		msgc2(id, "Tag activated", 0, 255, 0)
		USER[id]["tag"] = true
	end
]]

CreateChat "@say" "[text]" (0)[[
	if args >= 2 then
		local text = string.sub(txt, pos[2])
		if string.len(text) > 0 then
			USER[id]["tag"] = true
			AM.Say(id, text)
			USER[id]["tag"] = nil
		end
	end
]]

CreateChatAttachment(
	function (id,txt)
		if not USERIP[player(id,"ip")]["mute"] then
			if USER[id]["tag"] then
				local rank = SERVER_RANK[USER[id]["rank"]]
				local r = USER[id]["colorr"] or rank.r
				local g = USER[id]["colorg"] or rank.g
				local b = USER[id]["colorb"] or rank.b
				local name = USER[id]["name"] or "["..rank.prefix.."] "..player(id,"name")
				
				msgc(name..": "..txt, r, g, b)
				return 1
			end
		end
	end
)