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
end
end
function remtimer(id)
	_TIMER[id] = nil
end
_print = print
function print(...)
	local txt = table.concat({...}, '\t')
	return _print(type(txt) == "table" and table.tostring(txt) or tostring(txt))
end
function drawLine(x1, y1, x2, y2, tbl)
	if not (x1 and y1 and x2 and y2) then
		return false
	end
	tbl = tbl or {}
	local line = image('gfx/weiwen/1x1.png', 0, 0, tbl.mode or 1)
	local x3, y3, rot = (x1+x2)/2, (y1+y2)/2, math.deg(math.atan2(y1-y2, x1-x2))+90
	imagepos(line, x3, y3, rot)
	imagescale(line, tbl.width or 1, math.sqrt((x1-x2)^2+(y1-y2)^2))
	if tbl.color then
		imagecolor(line, tbl.color[1] or 0, tbl.color[2] or 0, tbl.color[3] or 0)
	end
	if tbl.alpha then
		imagealpha(line, tbl.alpha)
	end
	if tbl.blend then
		imageblend(line, tbl.blend)
	end
	return line
end
function laser(id)
	local x, y, rot = player(id, 'x'), player(id, 'y'), math.rad(player(id, 'rot'))
	addtimer(1000, freeimage, drawLine(x, y, x+math.sin(rot)*300, y-math.cos(rot)*300, {width = 10, color = {math.random(0, 255), math.random(0, 255), math.random(0, 255)}, alpha = 0.5}))
	radiussound('weapons/laser.ogg', x, y)
end
function hudtxt2(id,40, 'Testing', '255255255', 250,250,0)
parse("hudtxt2 " .. id .. " " .. txtid .. " \"©" .. tostring(colour) .. text .. "\" " .. x .. " " .. y .. " " .. align)
end