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
if sample==nil then sample={} end
sample.console={}
-----------------------
-- Parser Hook --
-----------------------
addhook("parse","sample.console.parse")
function sample.console.parse(cmd)
	-- My Server Info
	if (cmd=="myserverinfo") then
		print("Server Name: "..game("sv_name"))
		print("Max Players: "..game("sv_maxplayers"))
		return 2
	end
	-- Health List
	if (cmd=="healthlist") then
		for i=1,32 do
			if (player(i,"exists")) then
				hp=player(i,"health")
				if (hp>90) then
					print("©000255000"..player(i,"name").." -> HP: "..hp)
				elseif (hp>60) then
					print("©255255000"..player(i,"name").." -> HP: "..hp)
				elseif (hp>30) then
					print("©255128000"..player(i,"name").." -> HP: "..hp)
				else
					print("©255000000"..player(i,"name").." -> HP: "..hp)
				end
			end
		end
		return 2
	end
	
	-- Encage Players
	if (cmd=="encage") then
		parse("sv_msg ©255000000ENCAGING ALL PLAYERS!!!@C")
		a=player(0,"table")
		for i=1,#a do
			if (player(a[i],"team")>0) then
				if (player(a[i],"health")>0) then
					x=player(a[i],"tilex")
					y=player(a[i],"tiley")
					parse ("spawnobject 2 "..(x-1).." "..(y-1))
					parse ("spawnobject 2 "..(x).." "..(y-1))
					parse ("spawnobject 2 "..(x+1).." "..(y-1))
					parse ("spawnobject 2 "..(x-1).." "..(y))
					parse ("spawnobject 2 "..(x+1).." "..(y))
					parse ("spawnobject 2 "..(x-1).." "..(y+1))
					parse ("spawnobject 2 "..(x).." "..(y+1))
					parse ("spawnobject 2 "..(x+1).." "..(y+1))
				end
			end
		end
		return 2
	end
	-- No Command found, normal parsing
	return 0
end