Advertisement
Guest User

Untitled

a guest
Oct 19th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.71 KB | None | 0 0
  1. function GM:HUDPaint( )
  2.     self.BaseClass:HUDPaint()
  3.  
  4.         local ply = LocalPlayer()
  5.         local ob = ply:GetObserverTarget()
  6.         if ob and IsValid(ob) and ob:IsPlayer() and ob:Alive() then
  7.                 draw.AAText( ob:Nick(), "Deathrun_SmoothBig", ScrW()/2, 5, Color(255,255,255,255), TEXT_ALIGN_CENTER)
  8.                 ply = ob
  9.                 draw_keys = true
  10.         else
  11.                 draw_keys = false
  12.         end
  13.         if not keys[ply] then
  14.                 keys[ply] = {}
  15.         end
  16.  
  17.         local hy = ScrH() - 35
  18.  
  19.         draw.RoundedBox( 0, hx, hy, hw, hh, Color( 44, 44, 44, 175 ) )
  20.         draw.RoundedBox( 0, hx + border, hy + border, hw - border*2, hh - border*2, Color( 180, 80, 80, 255 ) )
  21.         local thp = ply:Alive() and ply:Health() or 0
  22.         local hp = thp
  23.         if hp > 0 then
  24.                 hp = ( hw - border*2 ) * ( math.Clamp(ply:Health(),0,100)/100)
  25.                 draw.RoundedBox( 0, hx + border, hy + border, hp, hh - border*2, Color( 80, 180, 60, 255 ) )
  26.         end
  27.  
  28.         draw.AAText( tostring( thp > 999 and "dafuq" or math.max(thp, 0) ), "Deathrun_SmoothBig", hx + 5, hy - 3, Color(255,255,255,255), TEXT_ALIGN_LEFT )
  29.  
  30.         surface.SetFont( "Deathrun_SmoothBig" )
  31.         local rt = string.ToMinutesSeconds(self:GetRoundTime())
  32.         local ttw, _ = surface.GetTextSize( rt )
  33.  
  34.         local tw = hw/2 + 5
  35.         draw.WordBox( 4, tw - ttw/2, hy - 45, rt, "Deathrun_SmoothBig", Color( 44, 44, 44, 200 ), Color( 255, 255, 255, 255 ) )
  36.  
  37.         if draw_keys then
  38.                 local w, h = 25, 25
  39.                 local scrh = ScrH()/2 + h
  40.                 local center = ScrW()/2 - w/2
  41.  
  42.                 local back_pos_y = scrh + h + 5
  43.  
  44.                 local Keys = keys[ply] or {}
  45.  
  46.                 surface.SetDrawColor( Color( 34, 45, 56, 50 ) )
  47.                 surface.DrawRect( center, scrh, w, h )
  48.  
  49.                 surface.SetDrawColor( Color( 34, 45, 56, 200 ) )
  50.                 if Keys[IN_FORWARD] then
  51.                         surface.DrawRect( center, scrh, w, h )
  52.                 end
  53.  
  54.                 surface.SetDrawColor( Color( 34, 45, 56, 50 ) )
  55.                 surface.DrawRect( center, back_pos_y, w, h )
  56.  
  57.                 if Keys[IN_BACK] then
  58.                         surface.SetDrawColor( Color( 55, 66, 77, 200 ) )
  59.                         surface.DrawRect( center, back_pos_y, w, h )
  60.                 end
  61.  
  62.                 surface.SetDrawColor( Color( 34, 45, 56, 50 ) )
  63.                 surface.DrawRect( center - w - 5, back_pos_y, w, h )
  64.  
  65.                 surface.SetDrawColor( Color( 123, 123, 123, 200 ) )
  66.                 if Keys[IN_MOVELEFT] then
  67.                         surface.DrawRect( center - w - 5, back_pos_y, w, h )
  68.                 end
  69.  
  70.                 surface.SetDrawColor( Color( 34, 45, 56, 50 ) )
  71.                 surface.DrawRect( center + w + 5, back_pos_y, w, h )
  72.  
  73.                 surface.SetDrawColor( Color( 123, 123, 123, 200 ) )
  74.                 if Keys[IN_MOVERIGHT] then
  75.                         surface.DrawRect( center + w + 5, back_pos_y, w, h )
  76.                 end
  77.         end
  78.  
  79.         local VEL = math.Round(LocalPlayer():GetVelocity():Length())
  80.        
  81.  surface.CreateFont( "MyFont", {
  82.         font            = "DefaultLarge",
  83.         size            = 50,
  84.         weight          = 500,
  85.         blursize        = 0,
  86.         scanlines       = 0,
  87.         antialias       = true,
  88.         underline       = false,
  89.         italic          = false,
  90.         strikeout       = false,
  91.         symbol          = false,
  92.         rotary          = false,
  93.         shadow          = false,
  94.         additive        = false,
  95.         outline         = false
  96. })
  97.  
  98. surface.CreateFont( "VelFont", {
  99.         font = "DefaultLarge",
  100.         size = 40,
  101.         weight = 600,
  102.         blursize = 0,
  103.         scanlines = 0,
  104.         antialias = true,
  105.         underline = false,
  106.         italic = false,
  107.         strikeout = false,
  108.         symbol = false,
  109.         rotary = false,
  110.         shadow = false,
  111.         additive = false,
  112.         outline = false,
  113. } )
  114.  
  115.         surface.SetTextColor( 46, 46, 254, 255)
  116.         surface.SetTextPos( 950, 1008 )
  117.         surface.SetFont( "MyFont" )
  118.         surface.DrawText( VEL )
  119.  
  120.  hook.Add( "HUDPaint", "Velocity", function()
  121.         draw.DrawText( "Velocity:", "VelFont", ScrW() * 0.457, ScrH() * 0.936, Color( 46, 46, 254, 255 ), TEXT_ALIGN_CENTER )
  122. end )
  123.  
  124.  
  125.  
  126.  function CoolHUD()
  127.         draw.RoundedBox( 0, ScrW() * 0.4195, ScrH() * 0.973, (LocalPlayer():GetVelocity():Length()/130)*100,25,Color(46, 46, 254, 255))
  128.         draw.RoundedBox( 4, ScrW() * 0.4195, ScrH() * 0.973, 500, 25, Color( 40, 40, 40, 120 ) )
  129. end
  130. hook.Add( "HUDPaint", "CoolHUD", CoolHUD )
  131.  
  132. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement