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
if not string.split then dofile("sys/lua/string.lua") end
god = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
--Hooks
addhook("join", "godzero")
addhook("say", "hook_say")
addhook("hit","hook_hit")
--Functions
function godzero(id)
	god[id] = 0
end
function hook_say(id, text)
	--text:qsplit() splits a string based on spaces and quotes
	local cmd = text:qsplit()
	if cmd[1] == "!makegod" then
		local id2 = tonumber(cmd[2])
		if not (id) then return end
		god[id2] = 1
	end
end
function hook_hit(id,source,weapon,hpdmg,apdmg)
	if (god[id] == 1) then
		return 1
	end
end