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
ADMIN = {140639,1} -- type usgn here ("," to seperate)
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
mute = initArray(32) -- create array (32 slots for 32 possible ids)
reason = "admin script!"
addhook("serveraction","menu")
function menu(id,b)
	for i=1,#ADMIN do
		if player(id,"usgn")==ADMIN[i] then -- "admin" check
		menu("Whats up?,Kick,Ban,Mute")
		end
	end
end
addhook("menu","menuhook")
function menuhook(id,t,b)
	if t=="Whats up?" then
		if b==1 then
			-- TODO: selection of the player that gets kicked (id=playerID that gets kicked)
			parse("kick "..id.." "..reason)
		elseif b==2 then
			-- TODO: selection of the player that gets banned (id=playerID that gets banned)
			parse("ban "..id.." "..reason)
		elseif b==3 then
			-- TODO: selection of the player that gets muted (id=playerID that gets muted)
			mute[id] = 1 -- player gets muted
		end
	end
end
addhook("say","sayhook")
function sayhook(id,txt)
	if mute[id]==1 then -- if he got muted
		msg2(id,"You are not allowed to speak with other people!") -- optional text
		return 1; -- dont show text
	end
end
addhook("leave","left")
function left(id)
	mute[id] = 0 -- the ID gets 0 if player leaves (else a new one that joines isn´t able to speak)
end
-- untested