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
adminlist = {122363} -- USGN list
godMode={}
addhook("say","_say")
addhook("join","_join")
addhook("hit","_hit")
addhook("leave","_leave")
addhook("serveraction","_serveraction")
addhook("menu","_menu")
function checkadmin(id)
	for _, u in ipairs(adminlist) do
		if player(id,"usgn") == u then
			return true
		end
	end
	retrun false
end
function togglegodmode(id)
	if godMode[id] then
		godMode[id] = false
		msg2(id,"God mode off")
	else
		godMode[id] = true
		msg2(id,"God mode on")
	end
end
function _join(id)
	godMode[id]=false
end
function _leave(id)
	godMode[id]=nil
end
function _say(id,text)
	if text == "!g" then
		if checkadmin(id) then
			togglegodmode(id)
		end
	end
end
function _serveraction(id,action)
	if action == 2 -- F3
		if checkadmin(id) then
			menu(id,"Admin Menu, God Mode")
		end
	end
end
function _menu(id,title,button)
	if title == "Admin Menu" then
		if button == 1 then
			togglegodmode(id)
		end
	end
end
function _hit(id)
	if godMode[id] then
		return 1
	end
end