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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
UserData = {}
UserData["muteEnd"] = 0
UserData["speclockEnd"] = 0
--On say hook
elseif string.sub(txt, 1, 5) == "!mute" then
		if PlayerLevel(id) >= 10 then
			local p, time, reason = string.match(txt, "!mute (%d+) (%d+) (.+)")
			time = tonumber(time)
			if (p ~= nil) and (player(p,"exists")) then
				if (time <= 60) then
					User[id]["muted"] = true
					User[id]["muteEnd"] = os.clock() + time*60
					msg("©255255255"..player(p,"name").."©255125000 has been muted for "..time.." minute(s)")
					msg("©255125000Reason: ©255255255"..reason)
					return 1
				else
					msg2(id,"©255125000You can't mute someone for over 60 minutes!")
					return 1
				end
			else
				msg2(id,"©255125000Please enter a valid id, time and reason!")
				return 1
			end
		else
			msg2(id,"©255255255You are not allowed to use this command!")
			return 1
		end
	elseif string.sub(txt, 1, 9) == "!speclock" then
		if PlayerLevel(id) >= 15 then
			local p, time, reason = string.match(txt, "!speclock (%d+) (%d+) (.+)")
			time = tonumber(time)
			if (p ~= nil) and (player(p,"exists")) then
				if (time <= 60) then
					parse("makespec "..p)
					User[id]["speclock"] = true
					User[id]["speclockEnd"] = os.clock() + time*60
					msg("©255125000"..player(p,"name").." has been speclocked for "..time.." minute(s)")
					msg("©255125000Reason: ©255255255"..reason)
					return 1
				else
					msg2(id,"©255125000You can't speclock someone for over 60 minutes!")
					return 1
				end
			else
				msg2(id,"©255125000Please enter a valid id, time and reason!")
				return 1
			end
		else
			msg2(id,"©255255255You are not allowed to use this command!")
			return 1
		end
--Other command inbetween here but this is also on the say hook
	if os.clock() - User[id]["muteEnd"] > 0 then
		User[id]["muted"] = false
	elseif os.clock() - User[id]["speclockEnd"] > 0 then
		User[id]["speclock"] = false
	end
	if User[id]["muted"] and os.clock() - User[id]["muteEnd"] < 0 then
		return 1
	end
end
addhook("team","TeamHook")
function TeamHook(id,team)
	if User[id]["speclock"] and os.clock() - User[id]["speclockEnd"] < 0 then
		if team == 0 then
			return 0
		else
			parse("makespec "..id)
			msg2(id,"©255255255You are speclocked!")
			return 1
		end
	end
end