Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. if SERVER then
  2. resource.AddFile( "resource/fonts/purista numbers.ttf" )
  3. resource.AddFile( "resource/fonts/purista semibold.ttf" )
  4. resource.AddFile( "materials/icons/heart.png" )
  5. resource.AddFile( "materials/icons/identification.png" )
  6. resource.AddFile( "materials/icons/employment.png" )
  7. resource.AddFile( "materials/icons/wanted.png" )
  8. return
  9. end
  10.  
  11. surface.CreateFont( "hudmain", {
  12. font = "BF4 Numbers",
  13. size = 20,
  14. weight = 200,
  15. } )
  16.  
  17. surface.CreateFont( "hudmainsmall", {
  18. font = "BF4 Numbers",
  19. size = 16,
  20. weight = 200,
  21. } )
  22.  
  23. local heart = Material("icons/heart.png")
  24. local shield = Material("icons/shield.png")
  25. local wanted = Material("icons/wanted.png")
  26. local id = Material("icons/identification.png")
  27. local employment = Material("icons/employment.png")
  28. local gradient = Material( "gui/gradient" )
  29.  
  30. local hideHUDElements = {
  31.  
  32. ["DarkRP_HUD"] = false,
  33. ["DarkRP_EntityDisplay"] = false,
  34. ["DarkRP_ZombieInfo"] = false,
  35. ["DarkRP_LocalPlayerHUD"] = true,
  36. ["DarkRP_Hungermod"] = true,
  37. ["DarkRP_Agenda"] = true
  38. }
  39. hook.Add("HUDShouldDraw", "HideDefaultDarkRPHud", function(name)
  40. if hideHUDElements[name] then return false end
  41. if name == "CHudHealth" or name == "CHudBattery" or name == "CHudSuitPower" or name == "CHudAmmo" or name == "CHudSecondaryAmmo" then return false end
  42. end)
  43.  
  44. function dyinglighthud()
  45.  
  46. local Health = LocalPlayer():Health() or 0
  47. if Health > 0 then Health = DrawHealth end
  48. if Health < 0 then Health = 0 end
  49. if Health >100 then Health = 100 end
  50.  
  51. local Armor = LocalPlayer():Armor() or 0
  52. if Armor > 0 then Armor = DrawArmor end
  53. if Armor < 0 then Armor = 0 end
  54. if Armor >100 then Armor = 100 end
  55.  
  56.  
  57. local Health = LocalPlayer():Health( )
  58. if Health < 36 then
  59. local speed = 2
  60. if Health < 21 then speed = 5 end
  61. HB = Color(math.Clamp(255 * math.sin(CurTime() * speed),100,255),0,0,255)
  62. else
  63. HB = Color(115,115,115,155)
  64. end
  65.  
  66. draw.RoundedBox(0,44, 45,276,30,Color(15,15,15,246))
  67.  
  68. end
  69.  
  70. hook.Add("HUDPaint", "DLH", dyinglighthud)
  71.  
  72. function DLH(name)
  73. for k, v in pairs ({"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"}) do
  74. if name == v then
  75. return false
  76. end
  77. end
  78. end
  79. hook.Add("HUDShouldDraw","HideDefaultHud", DLH)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement