1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function hc.chat.say_hook(p, text)
if text == "rank" then
return 0
end
local team = player(p, "team")
hc.chat.check_for_smileys(p, text)
if hc.is_vip(p) then
local colour_name = hc.get_player_property(p, hc.chat.COLOUR_PROP_NAME)
local colour
if colour_name then
colour = hc.chat.COLOURS[colour_name]
if colour and type(colour) == "table" then
colour = colour[team]
elseif not colour or colour == "nil" then
				colour = hc.SPEC_YELLOW
end
else
return 0
end
		local title = hc.WHITE
local show_tag = hc.get_player_property(p, hc.chat.TAG_PROP_NAME)
				
if show_tag == nil or show_tag == hc.chat.ON then
local tag = hc.chat.SAY_TAGS[hc.get_level(p)]
			
			title = title .. "»" .. tag .. "« " .. hc.user.COLOURS[team] .. player(p, "name")
		elseif show_tag == nil or show_tag == hc.chat.ON and colour == "nil" then
			title = title .. "»" .. tag .. "« " .. hc.user.COLOURS[team] .. player(p, "name")
		elseif show_tag == nil or show_tag == hc.chat.OFF then
			title = hc.user.COLOURS[team] .. player(p, "name")
end
text = hc.strip_end(text, "[©@]C", 2)
		if team == hc.SPEC or tonumber(game("sv_gamemode")) == hc.NORMAL and
			player(p, "health") == 0 then
			-- Spectating players and dead players in normal mode can't talk
			-- to living players.			
			return 0
		else
			msg(title .. ": " .. colour .. text)
		end
return 1
end
return 0
end