Advertisement
shaieve

Advanced Crosshair 1.0

Jul 13th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. CreateClientConVar("lenny_advcrosshair", 1, true, false)
  2. CreateClientConVar("lenny_advcrosshair_hitmarker", 1, true, false)
  3. CreateClientConVar("lenny_advcrosshair_info", 1, true, false)
  4.  
  5.  
  6. function advcrosshair()
  7. if GetConVarNumber("lenny_advcrosshair") == 1 then
  8. local x = ScrW() / 2
  9. local y = ScrH() / 2
  10. target = LocalPlayer():GetEyeTrace().Entity
  11. if LocalPlayer():Alive() and LocalPlayer():GetActiveWeapon():IsValid() and (target:IsPlayer() or target:IsNPC()) then
  12. crosscolor = Color(220,60,90, 150)
  13. surface.SetDrawColor(crosscolor)
  14. if GetConVarNumber("lenny_advcrosshair_info") == 1 then
  15. draw.DrawText("Heath: "..target:Health(), "Trebuchet18", x, y +25, Color(255,255,255, 150), 1)
  16.  
  17. end
  18. if GetConVarNumber("lenny_advcrosshair_hitmarker") == 1 then
  19. if LocalPlayer():KeyDown(IN_ATTACK) and LocalPlayer():GetActiveWeapon():Clip1() > 0 then
  20. surface.SetDrawColor(255,255,255)
  21. surface.DrawLine(x+15, y+15, x+8, y+8)
  22. surface.DrawLine(x-15, y-15, x-8, y-8)
  23. surface.DrawLine(x-15, y+15, x-8, y+8)
  24. surface.DrawLine(x+15, y-15, x+8, y-8)
  25. end
  26. end
  27.  
  28. else
  29. crosscolor = Color(255,255,255, 150)
  30. end
  31.  
  32.  
  33.  
  34.  
  35.  
  36. surface.SetDrawColor(crosscolor)
  37. local gap = 15
  38. local length = gap + 10
  39. surface.DrawLine( x - length, y, x - gap, y )
  40. surface.DrawLine( x + length, y, x + gap, y )
  41. surface.DrawLine( x, y - length, x, y - gap )
  42. surface.DrawLine( x, y + length, x, y + gap )
  43. surface.SetDrawColor(0, 255, 0)
  44. surface.DrawLine( x +2 , y, x -2, y)
  45. surface.DrawLine( x , y +2, x , y-2)
  46. end
  47. end
  48. hook.Add("HUDPaint", "advcrosshair", advcrosshair)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement