Advertisement
Guest User

Untitled

a guest
May 4th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. -- NOTHING YET.
  2. if SERVER then AddCSLuaFile("bnkhud.lua") return end
  3. function DrawBNKIndicator()
  4. local beacons = ents.FindByClass("bnkbeacon")
  5. for k, v in pairs(beacons) do
  6. if(v:IsValid()) then
  7. local Trg = (v:GetPos() + Vector(0, 0, 80)):ToScreen()
  8. local Disp = self:GetPlayer:GetShootPos() - Trg
  9. local len = sqrt((Disp.x)^2 + (Disp.y)^2 + (Disp.z)^2)
  10.  
  11. local scale = math.max(0.2 - 0.2 * len / 1000, 0.05)
  12. local scrw = surface.ScreenWidth()
  13. local scrh = surface.ScreenHeight()
  14. local xPos = Trg.x - scrw * scale / 2
  15. local yPos = Trg.y - scrw * scale / 2
  16. --if(scale > 0) and isInsideZone(xPos, yPos, 0, 0, scrw, scrh) then
  17. if(scale > 0) then
  18. --surface.SetDrawColor(25, 55, 155, 160)
  19. --surface.DrawRect(xPos, yPos, scrw * scale, scrw * scale)
  20. draw.RoundedBox(6, xPos, yPos, scrw * scale, scrw * scale, Color(25, 55, 155, 160))
  21. end
  22. end
  23. end
  24. end
  25. hook.Add("HUDPaintBackground", "DrawBNKIndicator", DrawBNKIndicator) -- used to be hudpaint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement