Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- NOTHING YET.
- if SERVER then AddCSLuaFile("bnkhud.lua") return end
- function DrawBNKIndicator()
- local beacons = ents.FindByClass("bnkbeacon")
- for k, v in pairs(beacons) do
- if(v:IsValid()) then
- local Trg = (v:GetPos() + Vector(0, 0, 80)):ToScreen()
- local Disp = self:GetPlayer:GetShootPos() - Trg
- local len = sqrt((Disp.x)^2 + (Disp.y)^2 + (Disp.z)^2)
- local scale = math.max(0.2 - 0.2 * len / 1000, 0.05)
- local scrw = surface.ScreenWidth()
- local scrh = surface.ScreenHeight()
- local xPos = Trg.x - scrw * scale / 2
- local yPos = Trg.y - scrw * scale / 2
- --if(scale > 0) and isInsideZone(xPos, yPos, 0, 0, scrw, scrh) then
- if(scale > 0) then
- --surface.SetDrawColor(25, 55, 155, 160)
- --surface.DrawRect(xPos, yPos, scrw * scale, scrw * scale)
- draw.RoundedBox(6, xPos, yPos, scrw * scale, scrw * scale, Color(25, 55, 155, 160))
- end
- end
- end
- end
- hook.Add("HUDPaintBackground", "DrawBNKIndicator", DrawBNKIndicator) -- used to be hudpaint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement