diff options
Diffstat (limited to 'gamemode/cl_hud/draw_playercircle.lua')
| -rw-r--r-- | gamemode/cl_hud/draw_playercircle.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gamemode/cl_hud/draw_playercircle.lua b/gamemode/cl_hud/draw_playercircle.lua new file mode 100644 index 0000000..68498aa --- /dev/null +++ b/gamemode/cl_hud/draw_playercircle.lua @@ -0,0 +1 @@ +local CIRCLE = surface.GetTextureID("SGM/playercircle")
local CIROFF = Vector(0,0,1)
local CIROF2 = Vector(0,0,10)
local CIRDOW = Vector(0,0,150)
local CIRANG = Angle(0,0,0)
local CIRENA = true
local CIRCOL = MAIN_COLOR
function GM:SetEnableMawCircle(bool)
CIRENA = bool
end
function GM:SetMawCircleTexture(TexID)
CIRCLE = TexID
end
function GM:SetMawCircleColor(Col)
CIRCOL = Col
end
hook.Add("PostPlayerDraw","DrawingPlayerCircle",function(pl)
if (!CIRENA) then return end
local p = pl:GetPos()
local t = {
start = p+CIROF2,
endpos = p-CIRDOW,
filter = pl,
mask = MASK_SOLID_BRUSHONLY,
}
t = util.TraceLine(t)
local B = CIRCOL.a*1
CIRCOL.a = math.Clamp(140-p:Distance(t.HitPos),0,250)
if (t.Hit) then
cam.Start3D2D(t.HitPos+CIROFF,CIRANG,0.2)
DrawTexturedRect( -100, -100, 200, 200, CIRCOL, CIRCLE)
cam.End3D2D()
end
CIRCOL.a = B
end)
\ No newline at end of file |
