1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
admins = { 12345, 54321 } -- USGN ID's
addhook("say","kick")
function kick(id,txt)
	for i=1,#admins do
		if player(id,"usgn") == admins[i] then
			if string.sub(txt, 1, 5) == "!kick" then
				local kid = string.sub(txt, 7, 8)
				parse("kick "..kid)
				return 1	-- don't show the text
			elseif string.sub(txt, 1, 4) == "!ban" then
				local bid = string.sub(txt, 6, 7)
				local usgn = player(bid,"usgn")
				parse("banip "..bid)
				if usgn ~= 0 then
					parse("banusgn "..usgn)	 -- if the player is logged into USGN, also ban his USGN ID
				end
				return 1	-- don't show the text
			end
		end
	end
end