Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include( 'shared.lua' )
- --[[---------------------------------------------------------
- Custom HUD
- ---------------------------------------------------------]]--
- function HUDHide ( myhud )
- for k, v in pairs{"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"} do
- if myhud == v then return false end
- end
- end
- hook.Add("HUDShouldDraw","HUDHide",HUDHide)
- -- HERE IS THE PROBLEM --
- function GM:HUDPaint()
- self.BaseClass:HUDPaint()
- local Ammo = LocalPlayer():GetActiveWeapon():Clip1()
- local SAmmo = LocalPlayer():GetActiveWeapon():Clip2()
- surface.CreateFont("CloseCaption_Bold", {size = 50, weight = 300, antialias = false, shadow = false, font = "FontAmmo"})
- surface.SetTextColor( 20, 180, 50, 255 )
- surface.SetTextPos( 30, ScrH() - 165 )
- surface.SetFont( "FontAmmo" ) -- This area is where the problem is! --
- surface.DrawText( Ammo )
- surface.CreateFont("CloseCaption_Normal", {size = 40, weight = 250, antialias = false, shadow = false, font = "FontSecAmmo"})
- surface.SetTextColor( 20, 180, 50, 255 )
- surface.SetTextPos( 60, ScrH() - 165 )
- surface.SetFont( "FontSecAmmo" )
- surface.DrawText( SAmmo )
- end
- -- END OF PROBLEM --
- function CoolHUD()
- local ply = LocalPlayer()
- local HP = ply:Health()
- local ARM = ply:Armor()
- draw.RoundedBox( 4, 100, ScrH() - 100, 200, 40, Color( 40, 40, 40, 120 ) )
- draw.RoundedBox( 4, 100, ScrH() - 100, math.Clamp( HP, 0, 200 )*2, 40, Color( 220, 108, 108, 255 ) )
- draw.RoundedBox( 4, 100, ScrH() - 100, math.Clamp( HP, 0, 200 )*2, 15, Color( 255, 255, 255, 40 ) )
- draw.RoundedBox( 4, 100, ScrH() - 145, 200, 40, Color( 40, 40, 40, 120 ) )
- draw.RoundedBox( 4, 100, ScrH() - 145, math.Clamp( ARM, 0, 200 )*2, 40, Color( 108, 108, 220, 255 ) )
- draw.RoundedBox( 4, 100, ScrH() - 145, math.Clamp( ARM, 0, 200 )*2, 15, Color( 255, 255, 255, 40 ) )
- end
- hook.Add( "HUDPaint", "CoolHUD", CoolHUD )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement