Advertisement
Guest User

Untitled

a guest
May 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. surface.CreateFont( "Font_1", {
  2. font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  3. extended = false,
  4. size = 16,
  5. weight = 500,
  6. blursize = 0,
  7. scanlines = 0,
  8. antialias = true,
  9. underline = true,
  10. italic = false,
  11. strikeout = false,
  12. symbol = false,
  13. rotary = false,
  14. shadow = true,
  15. additive = false,
  16. outline = false,
  17. } )
  18.  
  19. surface.CreateFont( "Font_2", {
  20. font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  21. extended = false,
  22. size = 30,
  23. weight = 500,
  24. blursize = 0,
  25. scanlines = 0,
  26. antialias = true,
  27. underline = true,
  28. italic = false,
  29. strikeout = false,
  30. symbol = false,
  31. rotary = false,
  32. shadow = true,
  33. additive = false,
  34. outline = false,
  35. } )
  36.  
  37. hook.Remove("HUDPaint","HUDSB")
  38.  
  39. hook.Add( "HUDShouldDraw", "HideHUD", function( name )
  40. if ( name == "CHudHealth" or name == "CHudBattery" or name == "CHudAmmo" or name == "CHudSecondaryAmmo" ) then
  41. return false
  42. end
  43. end )
  44.  
  45. hook.Add( "HUDPaint", "Hud", function()
  46. local Hud = {}
  47. --draw.RoundedBox(math.sin(CurTime()*100)*100+100, 256, 256, 256, 256, Color(255,0,0) )
  48. Hud["ScrH"] = ScrH()
  49. Hud["ScrW"] = ScrW()
  50. Hud["Health"] = LocalPlayer():Health()
  51. Hud["Armor"] = LocalPlayer():Armor()
  52. Hud["Ping"] = LocalPlayer():Ping()
  53. Hud["Waepon"] = LocalPlayer():GetActiveWeapon()
  54.  
  55. --Black Box
  56. draw.RoundedBox( 0, 0, Hud["ScrH"]-50, 300, 50, Color(0,0,0,220) )
  57. draw.RoundedBox( 0, 0, Hud["ScrH"]-20, 300, 20, Color(0,0,0,100) )
  58.  
  59. --Hp / Armor
  60. draw.RoundedBox( 0, 0, Hud["ScrH"]-50, math.Clamp(Hud["Health"],0,100)*3, 15, Color(255,0,0,255) )
  61. draw.DrawText( "Hp: "..Hud["Health"],"Font_1", 150, Hud["ScrH"]-50,Color(255,255,255,255),1 )
  62.  
  63. draw.RoundedBox( 0, 0, Hud["ScrH"]-35, math.Clamp(Hud["Armor"],0,100)*3, 15, Color(0,0,255,255) )
  64. draw.DrawText( "Armor: "..Hud["Armor"],"Font_1", 150, Hud["ScrH"]-35,Color(255,255,255,255),1 )
  65.  
  66. --Fps / Ping
  67. draw.DrawText( "Ping: "..Hud["Ping"],"Font_1", 5, Hud["ScrH"]-20,Color(255,255,255,255),0 )
  68.  
  69. --Ammo
  70. if LocalPlayer():Alive() and Hud["Waepon"]:GetClass()!="weapon_crowbar" and Hud["Waepon"]:GetClass()!="gmod_tool" and Hud["Waepon"]:GetClass()!="weapon_physcannon" and Hud["Waepon"]:GetClass()!="weapon_physgun" then
  71. draw.RoundedBox( 0, Hud["ScrW"]-150, Hud["ScrH"]-50, 150, 50, Color(0,0,0,220) )
  72. draw.RoundedBox( 0, Hud["ScrW"]-50, Hud["ScrH"]-50, 50, 50, Color(0,0,0,220) )
  73. draw.DrawText( Hud["Waepon"]:HasAmmo(),"Font_2", Hud["ScrW"]-50, Hud["ScrH"]-50,Color(255,255,255,255),1 )
  74. end
  75. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement