Advertisement
Guest User

Untitled

a guest
Dec 11th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. /*---------------------------------------------------------------------------
  2. The Custom HUD
  3. only draws health
  4. ---------------------------------------------------------------------------*/
  5. if ( SERVER ) then
  6.  
  7. AddCSLuaFile( "cl_hudreplacement.lua" )
  8.  
  9. end
  10.  
  11. surface.CreateFont( "HParmor", {
  12. font = "Gnuolane RG",
  13. size = 20,
  14. weight = 0,
  15. blursize = 0,
  16. scanlines = 0,
  17. antialias = true,
  18. underline = false,
  19. italic = false,
  20. strikeout = false,
  21. symbol = false,
  22. rotary = false,
  23. shadow = false,
  24. additive = false,
  25. outline = false
  26. } )
  27.  
  28. surface.CreateFont( "wallet", {
  29. font = "Gnuolane RG",
  30. size = 40,
  31. weight = 0,
  32. blursize = 0,
  33. scanlines = 0,
  34. antialias = true,
  35. underline = false,
  36. italic = false,
  37. strikeout = false,
  38. symbol = false,
  39. rotary = false,
  40. shadow = false,
  41. additive = false,
  42. outline = false
  43. } )
  44.  
  45. surface.CreateFont( "salary", {
  46. font = "Gnuolane RG",
  47. size = 25,
  48. weight = 0,
  49. blursize = 0,
  50. scanlines = 0,
  51. antialias = true,
  52. underline = false,
  53. italic = false,
  54. strikeout = false,
  55. symbol = false,
  56. rotary = false,
  57. shadow = false,
  58. additive = false,
  59. outline = false
  60. } )
  61.  
  62. surface.CreateFont( "name", {
  63. font = "Gnuolane RG",
  64. size = 30,
  65. weight = 0,
  66. blursize = 0,
  67. scanlines = 0,
  68. antialias = true,
  69. underline = false,
  70. italic = false,
  71. strikeout = false,
  72. symbol = false,
  73. rotary = false,
  74. shadow = false,
  75. additive = false,
  76. outline = false
  77. } )
  78.  
  79. local Health = 0
  80. function hidehud(name)
  81. for k, v in pairs{"CHudHealth", "CHudBattery", "CHudSecondaryAmmo", "CHudAmmo"} do
  82. if name == v then return false end
  83. end
  84. end
  85. hook.Add("HUDShouldDraw", "hidehud", hidehud)
  86.  
  87. local function hudPaint()
  88. local height = 40
  89. local ply = LocalPlayer()
  90. local hp = ply:Health()
  91. local job = ply:Team()
  92. local armor = ply:Armor()
  93. --local job = LocalPlayer().DarkRPVars.job
  94. --local wallet = LocalPlayer().DarkRPVars.money
  95. --local salary = LocalPlayer().DarkRPVars.salary
  96. local name = ply:Nick()
  97.  
  98.  
  99. -- math.Clamp( hp, 0, 100 )*2.8
  100. -- draw.RoundedBox( Number Bordersize, Number X, Number Y, Number Width, Number Height, Color Color )
  101.  
  102. -- Health Box
  103. draw.RoundedBox( 1, 23, ScrH() - height - 0, 400, 20, Color( 36, 36, 36, 255)) -- Health Background
  104. draw.RoundedBox( 0, 25, 1042, math.Clamp( hp, 0, 100 )*3.96, 16, Color( 230, 62, 62, 255)) -- Health Front
  105.  
  106. -- Armour Box
  107. draw.RoundedBox( 1, 23, ScrH() - height - 42, 400, 20, Color( 36, 36, 36, 255)) -- Armour Background
  108. draw.RoundedBox( 0, 25, 1000, math.Clamp( armor, 0, 100 )*3.96, 16, Color( 51, 105, 163, 255)) -- Health Front
  109.  
  110. -- Text Draws
  111. draw.DrawText(hp, "HParmor", 205, 1040, Color(255, 255, 255, 255 )) -- Heath Text
  112. draw.DrawText(armor, "HParmor", 205, 998, Color(255, 255, 255, 255 )) -- Armor Text
  113. --draw.DrawText(salary, "salary", 80, 950, Color(255, 255, 255, 255 )) -- Salary Number
  114. -- draw.DrawText("Salary:", "salary", 25, 950, Color(255, 255, 255, 255 )) -- Salary Text
  115. --draw.DrawText("$", "salary", 72, 950, Color(255, 255, 255, 255 )) -- Salary $ sign
  116.  
  117.  
  118. end
  119. hook.Add("HUDPaint", "DarkRP_Mod_HUDPaint", hudPaint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement