Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. local hideHUDElements = {
  2. ['DarkRP_HUD'] = true,
  3.  
  4. ['DarkRP_EntityDisplay'] = true,
  5. ['DarkRP_LocalPlayerHUD'] = true,
  6.  
  7. ['DarkRP_Hungermod'] = true,
  8. ['DarkRP_Agenda'] = true,
  9.  
  10. ['DarkRP_LockdownHUD'] = true,
  11. ['DarkRP_ArrestedHUD'] = true,
  12.  
  13. ['CHudHealth'] = true,
  14. ['CHudBattery'] = true,
  15.  
  16. ['CHudAmmo'] = true,
  17. ['CHudSecondaryAmmo'] = true
  18. }
  19.  
  20. hook.Add("HUDShouldDraw", "HideDefaultDarkRPHud", function(name)
  21. if hideHUDElements[name] or name == "CHudHealth" or name == "CHudBattery" then return false end
  22. end)
  23.  
  24.  
  25.  
  26.  
  27. hook.Add("HUDPaint", "DrawMyHud", function()
  28. local ply = LocalPlayer()
  29. local time = CurTime()
  30.  
  31. local armorBar = {
  32. { x = ScrW() / 2 - 320, y = ScrH() - 60 },
  33. { x = ScrW() / 2 - 80, y = ScrH() - 60 },
  34. { x = ScrW() / 2 - 80, y = ScrH() - 30 },
  35. { x = ScrW() / 2 - 340, y = ScrH() - 30 }
  36. }
  37.  
  38. local healthBar = {
  39. { x = ScrW() / 2 + 80, y = ScrH() - 60 },
  40. { x = ScrW() / 2 + 320, y = ScrH() - 60 },
  41. { x = ScrW() / 2 + 340, y = ScrH() - 30 },
  42. { x = ScrW() / 2 + 80, y = ScrH() - 30 }
  43. }
  44.  
  45. local PlayerHealth = {
  46. { x = ScrW() / 2 + 81, y = ScrH() - 60 },
  47. { x = ScrW() / 2 + 300*(ply:Health()/ 100), y = ScrH() - 60 },
  48. { x = ScrW() / 2 + ply:Health() * 3.2 , y = ScrH() - 30 },
  49. { x = ScrW() / 2 + 81, y = ScrH() - 30 }
  50. }
  51.  
  52. print(PlayerHealth[1]["x"])
  53. print(PlayerHealth[2]["x"])
  54. print(ply:Health())
  55.  
  56. surface.SetDrawColor(255, 255, 255, 15)
  57. draw.NoTexture()
  58. surface.DrawPoly(armorBar)
  59. surface.DrawPoly(healthBar)
  60.  
  61. surface.DrawRect(ScrW() / 2 - 70, ScrH() - 94 , 64, 64)
  62. surface.DrawRect(ScrW() / 2 + 6, ScrH() - 94 , 64, 64)
  63. surface.SetDrawColor(0, 153, 0, 220)
  64. surface.DrawPoly(PlayerHealth)
  65. surface.SetDrawColor(0, 206, 209, 220)
  66. //surface.DrawPoly(PlayerArmor)
  67. DrawHUDLines(healthBar)
  68. DrawHUDLines(armorBar)
  69.  
  70. end)
  71.  
  72. function DrawHUDLines(strTable)
  73. surface.SetDrawColor(255, 255, 255, 150)
  74. local count = 1
  75. for k, v in pairs(strTable) do
  76.  
  77. if count > 3 then
  78. surface.DrawLine(strTable[4]["x"], strTable[4]["y"], strTable[1]["x"], strTable[1]["y"])
  79. else
  80. surface.DrawLine(strTable[k]["x"], strTable[k]["y"], strTable[k + 1]["x"], strTable[k + 1]["y"])
  81. count = count + 1
  82. end
  83. end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement