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
addhook("use", "_use")
addhook("menu", "_menu")
local menus = {
{"Say Ts", "Sorry", "I no have weapons", "please no kill me!"},
{"Say CTs", "Follow me", "You have weapons?", "don't kill me"}
}
local colors = {
string.char(169).."255000000",
string.char(169).."050150255",
string.char(169).."255220000"
}
local first = {}
function _use(id)
if first[id] == nil then
first[id] = true
timer(300, "resetFirst", id)
else
menu(id, table.concat(menus[player(id, "team")], ","))
resetFirst(id)
end
end
function resetFirst(id)
first[tonumber(id)] = nil
end
function _menu(id, title, button)
if player(id, "team") ~= 0 and
player(id, "health") ~= 0 and
(title == menus[1][1] or
title == menus[2][1]) then
msg(colors[player(id, "team")]..player(id, "name")..": "..
colors[3]..menus[player(id, "team")][button + 1])
end
end