Advertisement
Deadman69330

Untitled

May 23rd, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.96 KB | None | 0 0
  1. surface.CreateFont( "font_money", {
  2.     font = "impact",
  3.     size = 20,
  4.     weight = 500,
  5.     blursize = 0,
  6.     scanlines = 0,
  7.     antialias = true,
  8. } )
  9.  
  10. hook.Add("HUDPaint", "Dhud", function()
  11. local texture_voice = surface.GetTextureID("voice/icntlk_pl")
  12. local heal = LocalPlayer():Health()
  13. local armor = LocalPlayer():Armor()
  14. local money = LocalPlayer():getDarkRPVar("money")
  15. local food = LocalPlayer():getDarkRPVar("Energy")
  16.  
  17. -- Food
  18.         draw.RoundedBox(4,ScrW()/190, ScrH()/1.08, food * 3, 20, Color(0,255,0,180))
  19.        
  20. -- Heal
  21.         if heal > 100 then
  22.             draw.RoundedBox(4,ScrW()/190, ScrH()/1.111, 300, 20, Color(255,0,0,180))
  23.         else
  24.             draw.RoundedBox(4,ScrW()/190, ScrH()/1.111, heal * 3, 20, Color(255,0,0,180))
  25.         end
  26.        
  27. -- Armor
  28.         if armor > 100 then
  29.             draw.RoundedBox(4,ScrW()/190, ScrH()/1.049, 300, 20, Color(0,0,255,180))
  30.         else
  31.             draw.RoundedBox(4,ScrW()/190, ScrH()/1.049, armor * 3, 20, Color(0,0,255,180))
  32.         end
  33.        
  34. -- Money
  35.         draw.SimpleText("Porte-Monnaie: "..money.." €", "font_money", ScrW()/1.1, ScrH()/1.05, Color(255,255,255))
  36.  
  37. end)
  38.  
  39.  
  40. local function DrawVoice(client)
  41.  
  42.     if (client.DRPIsTalking) then
  43.         local cx, cy = chat.GetChatBoxPos()
  44.         local rotating = math.sin(CurTime() * 3)
  45.         local backwards = 0
  46.  
  47.         if (rotating < 0) then
  48.             rotating = 1 - (1 + rotating)
  49.             backwards = 180
  50.         end
  51.  
  52.         surface.SetTexture(texture_voice)
  53.         surface.SetDrawColor(255,0,0)
  54.         surface.DrawTexturedRectRotated(ScrW() - 100, cy, rotating * 96, 96, backwards)
  55.  
  56.     end
  57.  
  58. end
  59.  
  60.  
  61. -- Retirer le HUD de base
  62. local hideHUDElements = {
  63.    ["DarkRP_HUD"] = true,
  64.    ["DarkRP_EntityDisplay"] = true,
  65.    ["DarkRP_ZombieInfo"] = false,
  66.    ["DarkRP_LocalPlayerHUD"] = true,
  67.    ["DarkRP_Hungermod"] = true,
  68.    ["DarkRP_Agenda"] = true,
  69.    ["CHudHealth"] = true,
  70.    ["CHudBattery"] = true,
  71.    ["CHudAmmo"] = true,
  72.    ["CHudSecondaryAmmo"] = true
  73. }
  74.  
  75. hook.Add("HUDShouldDraw", "HideDefaultElements", function(name)
  76.    if hideHUDElements[name] then return false end
  77. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement