1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
muted={}
for id = 1, 32 do
	muted[id] = false
end
addhook("say","sayhook")
function sayhook(id,txt)
	if not muted[id] then
		if txt:sub(1,5)=="!mute" then
			muted[id]=true
			return 1
		elseif txt:sub(1,7)=="!unmute" then
			muted[id]=false
			return 1
		end
	else
		return 1
	end
end
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
cmds = {
	[1]={
		cmd="!kick";
		action=function(me,target)
				if admin[me] and player(target,"exists") then
					msg(player(me,"name").." kicked "..player(target,"name"))
					parse("kick "..target)
				end
			end;
	};
	[2]={
		cmd="!kill";
		action=function(me,target)
				if admin[me] and player(target,"exists") then
					msg(player(me,"name").." killed "..player(target,"name"))
					parse("killplayer "..target)
				end
			end;
	};
}
addhook("say","sayhook2")
function sayhook2(id,txt)
	for cs = 1, #cmds do
		if txt:sub(1,1)=="!" then
			if txt:sub(1,txt:len(cmds[cs].cmd)) == cmds[cs].cmd then
				cmds[cs].action(id,txt:sub(txt:len(cmds[cs].cmd)+2))
			end
		end
	end
end