Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. --[[-------------------------------------------------------------------------
  2. Config
  3. ---------------------------------------------------------------------------]]--
  4.  
  5. colorhealth = Color(255,0,0) --Couleur de la barre de santé
  6. colorarmor = Color(0,0,255) --Couleur de la barre d'armure
  7. colorhunger = Color(255,153,0) --Couleur de la barre de faim
  8.  
  9.  
  10. local hideHUDElements = {
  11. ["DarkRP_HUD"] = true,
  12. ["DarkRP_EntityDisplay"] = true,
  13. ["DarkRP_ZombieInfo"] = true,
  14. ["DarkRP_LocalPlayerHUD"] = true,
  15. ["DarkRP_Hungermod"] = true,
  16. ["DarkRP_Agenda"] = true,
  17. }
  18.  
  19.  
  20.  
  21. --[[-------------------------------------------------------------------------
  22.  
  23. ---------------------------------------------------------------------------]]--
  24.  
  25.  
  26.  
  27.  
  28.  
  29. local function hideElements(name)
  30.  
  31. if name == "CHudHealth" or name == "CHudBattery" or name == "CHudSuitPower" then
  32. return false
  33. end
  34.  
  35. if hideHUDElements[name] then
  36. return false
  37. end
  38.  
  39. end
  40. hook.Add("HUDShouldDraw", "hideElements", hideElements)
  41.  
  42.  
  43.  
  44.  
  45. local function Health()
  46. local health = LocalPlayer():Health()
  47.  
  48. if health <= 100 then
  49. draw.RoundedBox(0,67.5,ScrH()-133.5,health*1.13,15,colorhealth)
  50. else if health > 100 then
  51. draw.RoundedBox(0,67.5,ScrH()-133.5,100*1.13,15,colorhealth)
  52. end
  53. end
  54.  
  55. draw.SimpleText( health.." %", "hs2", 125,ScrH()-136, Color(255,255,255), TEXT_ALIGN_CENTER)
  56.  
  57. end
  58.  
  59. local function Armor()
  60. local armor = LocalPlayer():Armor()
  61.  
  62. if armor <= 100 then
  63. draw.RoundedBox(0,67.5,ScrH()-92.5,armor*1.13,15,colorarmor)
  64. else if armor > 100 then
  65. draw.RoundedBox(0,67.5,ScrH()-92.5,100*1.13,15,colorarmor)
  66. end
  67. end
  68.  
  69. draw.SimpleText( armor.." %", "hs2", 125,ScrH()-95, Color(255,255,255), TEXT_ALIGN_CENTER)
  70.  
  71. end
  72.  
  73. local function Hunger()
  74. local food = LocalPlayer():getDarkRPVar("Energy")
  75.  
  76. draw.RoundedBox(0,67.5,ScrH()-51.5,food*1.13,15,colorhunger)
  77.  
  78. draw.SimpleText( food.." %", "hs2", 125,ScrH()-54, Color(255,255,255), TEXT_ALIGN_CENTER)
  79.  
  80. end
  81.  
  82. --[[-------------------------------------------------------------------------
  83. Background
  84. ---------------------------------------------------------------------------]]--
  85.  
  86. local function Base()
  87.  
  88. surface.SetDrawColor( 255, 255, 255, 255 )
  89. surface.SetMaterial( Material("hud_syndicate/hud1.png"))
  90. surface.DrawTexturedRect( 20, ScrH()-202.4, 324, 182.4 )
  91.  
  92. surface.SetMaterial( Material("hud_syndicate/logo1.png"))
  93. surface.DrawTexturedRect( 350 ,ScrH()-50, 50, 50 )
  94.  
  95. end
  96.  
  97. --[[-------------------------------------------------------------------------
  98.  
  99. ---------------------------------------------------------------------------]]--
  100.  
  101. local function Job()
  102. local job = team.GetName(LocalPlayer():Team())
  103.  
  104. draw.SimpleText( job, "hs1-2", 240, ScrH()-135, Color(255,255,255), TEXT_ALIGN_LEFT)
  105.  
  106. end
  107.  
  108. local function Money()
  109. local money = LocalPlayer():getDarkRPVar("money")
  110.  
  111. draw.SimpleText( money.." €", "hs1", 235, ScrH()-93, Color(255,255,255), TEXT_ALIGN_LEFT)
  112.  
  113. end
  114.  
  115. local function Salary()
  116. local salary = LocalPlayer():getDarkRPVar("salary")
  117.  
  118. draw.SimpleText( salary.." €", "hs1", 245, ScrH()-55, Color(255,255,255), TEXT_ALIGN_LEFT)
  119.  
  120. end
  121.  
  122. local function Name()
  123. local name = LocalPlayer():Name()
  124.  
  125. draw.SimpleText( name, "hs1-2", 70, ScrH()-197, Color(255,255,255), TEXT_ALIGN_LEFT)
  126.  
  127. end
  128.  
  129. local function Rank()
  130.  
  131. surface.SetDrawColor( 255, 255, 255, 255 )
  132. if LocalPlayer():GetUserGroup() == "VIP" then
  133. surface.SetMaterial( Material("hud_syndicate/vip1.png"))
  134. surface.DrawTexturedRect( 350 ,ScrH()-80, 35, 35 )
  135. else if LocalPlayer():GetUserGroup() == "superadmin" then
  136. surface.SetMaterial( Material("hud_syndicate/vip1.png"))
  137. surface.DrawTexturedRect( 350 ,ScrH()-80, 35, 35 )
  138. else if LocalPlayer():GetUserGroup() == "Super-Admin" then
  139. surface.SetMaterial( Material("hud_syndicate/vip1.png"))
  140. surface.DrawTexturedRect( 350 ,ScrH()-80, 35, 35 )
  141. else if LocalPlayer():GetUserGroup() == "Administrateur" then
  142. surface.SetMaterial( Material("hud_syndicate/vip1.png"))
  143. surface.DrawTexturedRect( 350 ,ScrH()-80, 35, 35 )
  144. else if LocalPlayer():GetUserGroup() == "Modérateur" then
  145. surface.SetMaterial( Material("hud_syndicate/vip1.png"))
  146. surface.DrawTexturedRect( 350 ,ScrH()-80, 35, 35 )
  147. else if LocalPlayer():GetUserGroup() == "Modo-Test" then
  148. surface.SetMaterial( Material("hud_syndicate/vip1.png"))
  149. surface.DrawTexturedRect( 350 ,ScrH()-80, 35, 35 )
  150. else if LocalPlayer():GetUserGroup() == "VIP+" then
  151. surface.SetMaterial( Material("hud_syndicate/vip1.png"))
  152. surface.DrawTexturedRect( 350 ,ScrH()-80, 35, 35 )
  153. end
  154. end
  155. end
  156. end
  157. end
  158. end
  159. end
  160.  
  161. end
  162.  
  163. local function GunLicense()
  164.  
  165. if LocalPlayer():getDarkRPVar("HasGunlicense") then
  166. surface.SetDrawColor( 255, 255, 255, 255 )
  167. surface.SetMaterial( Material("hud_syndicate/licence1.png"))
  168. surface.DrawTexturedRect( 350 ,ScrH()-115, 40, 40 )
  169. end
  170.  
  171. end
  172.  
  173.  
  174.  
  175.  
  176. local function DrawHUDSyn()
  177.  
  178. Health()
  179. Armor()
  180. Hunger()
  181. Base()
  182. Job()
  183. Money()
  184. Salary()
  185. Name()
  186. Rank()
  187. GunLicense()
  188.  
  189. end
  190. hook.Add("HUDPaint", "DrawHUDSyn", DrawHUDSyn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement