Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1.  
  2. ---------------------------------------------------------------------------
  3. --HUD--
  4. ---------------------------------------------------------------------------
  5.  
  6. surface.CreateFont( "Hud", {
  7. font = "coolvetica rg", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  8. extended = false,
  9. size = 18,
  10. weight = 500,
  11. blursize = 0,
  12. scanlines = 0,
  13. antialias = true,
  14. underline = false,
  15. italic = false,
  16. strikeout = false,
  17. symbol = false,
  18. rotary = false,
  19. shadow = false,
  20. additive = false,
  21. outline = false,
  22. } )
  23.  
  24. hook.Add("HUDPaint" , "DrawHUD", function()
  25.  
  26. local health = LocalPlayer():Health()
  27. local armor = LocalPlayer():Armor()
  28. local ply = LocalPlayer()
  29.  
  30. draw.RoundedBox(0,10,ScrH() -150,350,140,Color(32,32,32,230))
  31. draw.RoundedBox(0,10,ScrH() -155,350,25,Color(66,139,202))
  32.  
  33. draw.SimpleText(ply:Nick(),"Hud",10,100,150,Color(255,255,255))
  34.  
  35.  
  36. draw.RoundedBox(0,155,ScrH() -80,200,25,Color(32,32,32,200))
  37. draw.RoundedBox(0,155,ScrH() -80,health * 2,25,Color(255,51,51))
  38. draw.SimpleText(health.." Health","Hud",230,ScrH() -78,Color(255,255,255))
  39.  
  40. draw.RoundedBox(0,155,ScrH() -50,200,25,Color(32,32,32,200))
  41. draw.RoundedBox(0,155,ScrH() -50,health * 2,25,Color(0,128,255))
  42. draw.SimpleText(armor.." Armor","Hud",230,ScrH() -48,Color(255,255,255))
  43.  
  44.  
  45.  
  46.  
  47.  
  48. end)
  49.  
  50. local icon = vgui.Create("DModelPanel")
  51. icon:SetSize(100,100)
  52. icon:SetPos(0,ScrH() - (120 - 5))
  53. icon:SetModel(LocalPlayer():GetModel())
  54. function icon:LayoutEntity(Entity) return end
  55. function icon.Entity:GetPlayerColor() return Vector(1,0,0) end
  56. icon:SetFOV(10)
  57. icon:SetCamPos(Vector(90,-20,70))
  58. icon:SetLookAt(Vector(0,0,65))
  59. icon.Entity:SetEyeTarget(Vector(200, 200, 100))
  60. timer.Create("UpdateIcon",0.5, 0,function()
  61. if icon:IsValid() and LocalPlayer():GetModel() != icon.Entity:GetModel() then
  62. icon:SetModel(LocalPlayer():GetModel())
  63. end
  64. end)
  65.  
  66. local hide =
  67. {
  68. ["CHudHealth"] = true,
  69. ["CHudBattery"] = true
  70. }
  71.  
  72. hook.Add( "HUDShouldDraw", "HideHUD", function( name )
  73. if ( hide[name] ) then return false end
  74.  
  75. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement