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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
function Array(v,m,z)
	if not z then z = 1 end
	if not m then m = 32 end
	if not v then v = 0 end
	local t = {}
	for i = z,m do
		t[i] = v
	end
	return t
end
function toTable(t,m)
	if not m then m = "%s" end
	local t = {}
	for w in string.gmatch(t,"[^"..m.."]+") do
		table.insert(t,w)
	end
	return t
end
adminList = {16138,16138} --Put your USGN in here
function isAdmin(id,tbl)
	if not tbl then tbl = adminList end
	if not id then return nil end
	for i,v in ipairs(tbl) do
		if player(id,"usgn") == v then
			return true
		end
	end
	return false
end
function setpos(id,x,y,tile)
	if not id then return nil end
	if not x then return nil end
	if not y then return nil end
	if not tile then tile = 0 end
	if x > 0 and y > 0 and y < map("ysize") * 32 and x < map("xsize") * 32 then
		if tile == 0 then
			parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
		else
			x = x * 32 + 16
			y = y * 32 + 16
			parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
		end
	end
end
function equip(id,...)
	if id == 0 then
		for _,i in ipairs(player(0,"table")) do
			for wpn = 1,#arg do
				parse([[equip ]]..i..[[ ]]..arg[wpn])
			end
		end
	else
		for wpn = 1,#arg do
			parse([[equip ]]..id..[[ ]]..arg[wpn])
		end
	end
end
function explosion(dmg,grt,x,y,id,tile)
	if not id then id = "" end
	if not tile then tile = 0 end
	if tile == 0 then
		parse([[sexplosion ]]..dmg..[[ ]]..grt..[[ ]]..x..[[ ]]..y..[[ ]]..id)
	else
		x = x * 32 + 16
		y = y * 32 + 16
		parse([[sexplosion ]]..dmg..[[ ]]..grt..[[ ]]..x..[[ ]]..y..[[ ]]..id)
	end
end
function hudtxt(i,txt,x,y,algin)
	if not algin then algin = 0 end
	parse([[hudtxt ]]..i..[[ "]]..txt..[[" ]]..x..[[ ]]..y..[[ ]]..algin)
end
function hudtxt2(id,i,txt,x,y,algin)
	if not algin then algin = 0 end
	parse([[hudtxt2 ]]..id..[[ ]]..i..[[ "]]..txt..[[" ]]..x..[[ ]]..y..[[ ]]..algin)
end
function spawnobject(bid,x,y,rot,mode,team,id)
	if not id then id = "" end
	if not team then team = 3 end
	if not mode then mode = 0 end
	if not rot then rot = 0 end
	parse([[spawnobject ]]..bid..[[ ]]..x..[[ ]]..y..[[ ]]..rot..[[ ]]..mode..[[ ]]..team..[[ ]]..id)
end
_math = math
function math.sqrt(x,y)
	return _math.sqrt(x^2 + y^2)
end