Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.92 KB | None | 0 0
  1. local hideHUDElements = {
  2. -- if you DarkRP_HUD this to true, ALL of DarkRP's HUD will be disabled. That is the health bar and stuff,
  3. -- but also the agenda, the voice chat icons, lockdown text, player arrested text and the names above players' heads
  4. ["DarkRP_HUD"] = false,
  5.  
  6. -- This is the one you're most likely to replace first
  7. -- DarkRP_LocalPlayerHUD is the default HUD you see on the bottom left of the screen
  8. -- It shows your health, job, salary and wallet, but NOT hunger (if you have hungermod enabled)
  9. ["DarkRP_LocalPlayerHUD"] = true,
  10.  
  11. -- If you have hungermod enabled, you will see a hunger bar in the DarkRP_LocalPlayerHUD
  12. -- This does not get disabled with DarkRP_LocalPlayerHUD so you will need to disable DarkRP_Hungermod too
  13. ["DarkRP_Hungermod"] = true,
  14.  
  15. -- Drawing the DarkRP agenda
  16. ["DarkRP_Agenda"] = true,
  17.  
  18. -- Lockdown info on the HUD
  19. ["DarkRP_LockdownHUD"] = true,
  20.  
  21. -- Arrested HUD
  22. ["DarkRP_ArrestedHUD"] = true,
  23.  
  24. [ 'CHudAmmo' ] = true,
  25. [ 'CHudBattery' ] = true,
  26. [ 'CHudHealth' ] = true,
  27. }
  28.  
  29. -- this is the code that actually disables the drawing.
  30. hook.Add("HUDShouldDraw", "HideDefaultDarkRPHud", function(name)
  31. if hideHUDElements[name] then return false end
  32. end)
  33.  
  34. LocalPlayer().DarkRPVars = LocalPlayer().DarkRPVars or {}
  35.  
  36. --If the money is not set, don't do anything
  37. local v1 = LocalPlayer().DarkRPVars.money
  38. if not v1 then v1 = "" end
  39.  
  40. --If the salary is not set, don't do anything
  41. local v2 = LocalPlayer().DarkRPVars.salary
  42. if not v2 then v2 = "" end
  43.  
  44. local GunLicense = LocalPlayer():getDarkRPVar("HasGunlicense")
  45.  
  46. if GunLicense then GunLicense = "Yes" else GunLicense = "No" end
  47.  
  48. local self = LocalPlayer()
  49. if not self:Alive() or not IsValid( self:GetActiveWeapon() ) then return end
  50. local ammo, reserve = self:GetActiveWeapon():Clip1() < 0 and -2 or self:GetActiveWeapon():Clip1(), self:GetAmmoCount( self:GetActiveWeapon():GetPrimaryAmmoType() )
  51. local name = self:GetActiveWeapon():GetPrintName()
  52. local disabled = ammo <= 0 and reserve <= 0 and true or false
  53.  
  54. surface.CreateFont( "CustomFont", {
  55. font = "Myriad", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  56. extended = false,
  57. size = 17,
  58. weight = 1000,
  59. blursize = 0,
  60. scanlines = 0,
  61. antialias = true,
  62. underline = false,
  63. italic = false,
  64. strikeout = false,
  65. symbol = false,
  66. rotary = false,
  67. shadow = false,
  68. additive = false,
  69. outline = false,
  70. } )
  71.  
  72. surface.CreateFont( "CustomFont2", {
  73. font = "Myriad", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  74. extended = false,
  75. size = 12,
  76. weight = 1000,
  77. blursize = 0,
  78. scanlines = 0,
  79. antialias = true,
  80. underline = false,
  81. italic = false,
  82. strikeout = false,
  83. symbol = false,
  84. rotary = false,
  85. shadow = false,
  86. additive = false,
  87. outline = false,
  88. } )
  89.  
  90. PropLimitation = {}
  91. PropLimitation["superadmin"] = { Limitation = 200 }
  92. PropLimitation["moderator"] = { Limitation = 50 }
  93. PropLimitation["user"] = { Limitation = 25 }
  94.  
  95. --draw.DrawText( PropCount.. " / "..PropLimit, "font", xposition, yposition, Color( 255,255,255 ), TEXT_ALIGN_CENTER )
  96.  
  97. hook.Add( "HUDPaint", "HUDIdent", function()
  98.  
  99. local PropRankDetection = PropLimitation[LocalPlayer():GetNWString("usergroup", "")]
  100. local PropLimit = PropRankDetection and PropRankDetection.Limitation or "NIL"
  101. local PropCount = LocalPlayer():GetCount("props")
  102.  
  103. draw.RoundedBox( 0, 0, ScrH()-40, ScrW(), 50, Color( 25, 25, 25, 225)) -- curvachure, x, y, width, height, rgb/alpha
  104.  
  105. surface.SetDrawColor( 120, 120, 120, 255 )
  106. draw.RoundedBox( 0, 0, ScrH()-35, ScrW(), 30, Color( 120, 120, 120, 255 ))
  107.  
  108. surface.SetDrawColor( 192, 43, 43, 120 )
  109. draw.RoundedBox( 0, 0, ScrH()-35, ScrW(), 30, Color( 192, 43, 43, 120 ))
  110.  
  111. surface.SetDrawColor( 0, 0, 255, 100 )
  112. draw.RoundedBox( 0, 0, ScrH()-35, ScrW(), 30, Color( 0, 0, 255, 100 ))
  113.  
  114. surface.SetDrawColor( 0, 255, 0, 100 )
  115. draw.RoundedBox( 0, 0, ScrH()-35, ScrW(), 30, Color( 0, 255, 0, 100 ))
  116.  
  117. surface.SetDrawColor( 0, 230, 0, 100 )
  118. draw.RoundedBox( 0, 0, ScrH()-35, ScrW(), 30, Color( 0, 230, 0, 100 ))
  119.  
  120. surface.SetDrawColor( 255, 255, 0, 100 )
  121. draw.RoundedBox( 0, 0, ScrH()-35, ScrW(), 30, Color( 255, 255, 0, 100 ))
  122.  
  123. surface.SetDrawColor( 25, 25, 25, 200 )
  124. draw.RoundedBox( 0, 0, ScrH()-35, ScrW(), 30, Color( 25, 25, 25, 200 ))
  125.  
  126. -- Name
  127. surface.SetTexture(surface.GetTextureID("gui/silkicons/user"))
  128. -- surface.DrawTexturedRect(25 + 10,ScrH() - 160,16,16)
  129. draw.SimpleText("Name: "..LocalPlayer():Nick(),"CustomFont", 25 + 30,ScrH() - 30, Color(255,255,255))
  130. -- Money
  131. surface.SetTexture(surface.GetTextureID("gui/silkicons/money"))
  132. -- surface.DrawTexturedRect(25 + 10,ScrH() - 140,16,16)
  133. draw.SimpleText("Money: $" .. v1,"CustomFont", ScrW() - ScrW() + 765,ScrH() - 30, Color(255,255,255))
  134. -- Salary
  135. surface.SetTexture(surface.GetTextureID("gui/silkicons/money_add"))
  136. -- surface.DrawTexturedRect(25 + 10,ScrH() - 120,16,16)
  137. draw.SimpleText("Salary: $" .. v2,"CustomFont", ScrW() - ScrW() + 950,ScrH() - 30, Color(255,255,255))
  138. -- Job
  139. surface.SetTexture(surface.GetTextureID("gui/silkicons/group"))
  140. -- surface.DrawTexturedRect(25 + 10,ScrH() - 100,16,16)
  141. draw.SimpleText("Job: "..LocalPlayer().DarkRPVars.job,"CustomFont", ScrW() - ScrW() + 1125,ScrH() - 30, Color(255,255,255))
  142. -- Health
  143. surface.SetTexture(surface.GetTextureID("gui/silkicons/heart"))
  144. -- surface.DrawTexturedRect(25 + 10,ScrH() - 80,16,16)
  145. draw.SimpleText("Health: "..LocalPlayer():Health() ,"CustomFont", ScrW() - ScrW() + 430,ScrH() - 30, Color(255,255,255))
  146. -- Armour
  147. surface.SetTexture(surface.GetTextureID("gui/silkicons/shield"))
  148. -- surface.DrawTexturedRect(25 + 10,ScrH() - 60,16,16)
  149. draw.SimpleText("Armour: "..LocalPlayer():Armor() ,"CustomFont", ScrW() - ScrW() + 600,ScrH() - 30, Color(255,255,255))
  150. -- Has License
  151. surface.SetTexture(surface.GetTextureID("gui/silkicons/shield"))
  152. -- surface.DrawTexturedRect(25 + 10,ScrH() - 60,16,16)
  153. draw.SimpleText("Has Gun License: "..GunLicense ,"CustomFont", ScrW() - ScrW() + 1350,ScrH() - 30, Color(255,255,255))
  154. -- FPS
  155. surface.SetTexture(surface.GetTextureID("gui/silkicons/shield"))
  156. draw.SimpleText("FPS: "..math.floor(1 / RealFrameTime()) ,"CustomFont2", ScrW()-100,ScrH() - 40, Color(255,255,255))
  157. -- Ping
  158. surface.SetTexture(surface.GetTextureID("gui/silkicons/shield"))
  159. draw.SimpleText("Ping: "..LocalPlayer():Ping() ,"CustomFont2", ScrW()-100,ScrH() - 27, Color(255,255,255))
  160. -- Props
  161. surface.SetTexture(surface.GetTextureID("gui/silkicons/shield"))
  162. draw.SimpleText("Props: "..LocalPlayer():GetCount( "props" ).."/"..PropLimit,"CustomFont2", ScrW() - 100,ScrH() - 14, Color(255,255,255))
  163. -- Ammo
  164. surface.SetTexture(surface.GetTextureID("gui/silkicons/shield"))
  165. -- surface.DrawTexturedRect(25 + 10,ScrH() - 60,16,16)
  166. draw.SimpleText( name..": "..ammo.."/"..reserve ,"CustomFont", ScrW() - ScrW() + 1550,ScrH() - 30, Color(255,255,255))
  167.  
  168. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement