Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. local Health = Material("addons/Marvelous_hud/materials/galactic/ui/health.png")
  2. local Armor = Material("addons/Marvelous_hud/materials/galactic/ui/backpack.png")
  3. local Money = Material("addons/Marvelous_hud/materials/galactic/ui/wallet.png")
  4. local Name = Material("addons/Marvelous_hud/materials/galactic/ui/community.png")
  5.  
  6. function draw.OutlinedBox( x, y, w, h, thickness, clr )
  7. surface.SetDrawColor( clr )
  8. for i=0, thickness - 1 do
  9. surface.DrawOutlinedRect( x + i, y + i, w - i * 2, h - i * 2 )
  10. end
  11. end
  12.  
  13. function HUD()
  14. local client = LocalPlayer()
  15.  
  16. if !client:Alive() then
  17. return
  18. end
  19.  
  20. --Health--
  21. draw.RoundedBox(0, 0, ScrH() - 780, 150, 50, Color(155, 0, 18, 230))
  22. draw.RoundedBox(0, 0, ScrH() - 810, 150, 50, Color(204, 10, 10, 255))
  23. draw.OutlinedBox( 0, 0, 150, 40, 2, Color( 104, 102, 103, 230 ))
  24. draw.SimpleText("Health ", "DermaDefaultBold", 35, ScrH() - 753, Color(255, 255, 255, 255), 0, 0)
  25. draw.SimpleText(""..client:Health(), "DermaDefaultBold", 120, ScrH() - 753, Color(255, 255, 255),0 ,0)
  26. surface.SetMaterial(Health)
  27. surface.SetDrawColor(255,255,255,255)
  28. surface.DrawTexturedRect(5, 13, 20, 20, 2, Color(255, 255, 255, 255))
  29.  
  30. -- Armor --
  31. draw.RoundedBox(0, 150, ScrH() - 780, 150, 50, Color(29, 45, 109, 230))
  32. draw.RoundedBox(0, 150, ScrH() - 810, 150, 50, Color(16, 74, 165, 255))
  33. draw.OutlinedBox( 0, 0, 300, 40, 2, Color( 104, 102, 103, 230 ))
  34. draw.SimpleText("Armour ", "DermaDefaultBold", 185, ScrH() - 753, Color(255, 255, 255, 255), 0, 0)
  35. draw.SimpleText(""..client:Armor(), "DermaDefaultBold", 280, ScrH() - 753, Color(255, 255, 255),0 ,0)
  36. surface.SetMaterial(Armor)
  37. surface.SetDrawColor(255,255,255,255)
  38. surface.DrawTexturedRect(155, 13, 20, 20, 2, Color(255, 255, 255, 255))
  39.  
  40. -- Credits --
  41. draw.RoundedBox(0, 300, ScrH() - 780, 150, 50, Color(7, 117, 34, 230))
  42. draw.RoundedBox(0, 300, ScrH() - 810, 150, 50, Color(0, 196, 48, 255))
  43. draw.OutlinedBox( 0, 0, 450, 40, 2, Color( 104, 102, 103, 230))
  44. draw.SimpleText("Credits ", "DermaDefaultBold", 345, ScrH() - 753, Color(255, 255, 255, 255), 0, 0)
  45. draw.SimpleText("" ..client:GetNWInt("playerMoney"), "DermaDefaultBold", 430, ScrH() - 753, Color(255, 255, 255), 0, 0)
  46. surface.SetMaterial(Money)
  47. surface.SetDrawColor(255,255,255,255)
  48. surface.DrawTexturedRect(310, 13, 20, 20, 2, Color(255, 255, 255, 255))
  49.  
  50. end
  51. hook.Add("HUDPaint", "TestHud", HUD)
  52.  
  53.  
  54. local function DrawPlayerInfo(ply)
  55. local pos = ply:EyePos()
  56.  
  57. pos.z = pos.z + 10 -- The position we want is a bit above the position of the eyes
  58.  
  59. pos = pos:ToScreen()
  60.  
  61. pos.y = pos.y - 50 -- Move the text up a few pixels to compensate for the height of the text
  62.  
  63. -- hud code for above head
  64.  
  65. --name--
  66.  
  67.  
  68. --Health--
  69.  
  70.  
  71.  
  72. --Rank--
  73.  
  74.  
  75. end
  76.  
  77. function HideHud(name)
  78. for k, v in pairs({"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"}) do
  79. if name == v then
  80. return false
  81. end
  82. end
  83. end
  84. hook.Add("HUDShouldDraw", "HideDefaultHud", HideHud)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement