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
snd = {[0] = "/server/lightningbolt.ogg",[1] = "/server/shock.ogg"}
function search_in_table(array, what)
	for i in ipairs(array) do
		if (array[i]==what) then
			return 1
		end
	end
	return 0
end
addhook("say","slay")
function slay(p,txt)
auth = {1247}
usgn = player(p,"usgn")
if (search_in_table(auth, usgn)==1) then
	if (txt == "!slay") then
		msg2(p,"©245128015You must type '!slay #' to slay. Instead of '#' type a numeric value.@C")
		return 0
	elseif (txt == "!slay #") then
		msg2(p,"©245075075You must add a player id to slay.@C")
		return 0
	elseif (txt == "!slay 0") then
		msg2(p,"©102255102The player id must be above 0 and less than 32.@C")
		return 0
	end
end
if (string.sub(txt, 1, 5) == "!slay") then
	if (search_in_table(auth, usgn)==1) then
		slay = tonumber(string.sub(txt, 7, string.len(txt)))
		msg2(p,"©235235235You have used slay lightning.@C")
		parse("killplayer "..slay)
		--parse("customkill \"Slay lightning\" "..slay.."")
		--parse("sv_sound2 "..slay.." "..snd[0])
		parse("sv_sound2 "..p.." "..snd[1])
		parse("sv_sound "..snd[0])
	elseif (search_in_table(not auth, usgn)==1) then
		msg2(p,"©235235235You are not authorized to use slay lightning.@C")
	return 0
	end
end
end
itself that contains bugs I assume.