Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- surface.CreateFont("JaxHUDFont", {
- font = "Coolvetica",
- size = 20,
- weight = 500
- })
- local HealthBG = {}
- HealthBG[1] = { x = ScrW(), y = ScrH(), u = 1, v = 1 }
- HealthBG[2] = { x = ScrW() - 100, y = ScrH()/1.03, u = 1, v = 0 }
- HealthBG[3] = { x = 100, y = ScrH()/1.03, u = 0, v = 0 }
- HealthBG[4] = { x = 0, y = ScrH(), u = 0, v = 1 }
- local ArmorBG = {}
- ArmorBG[1] = { x = ScrW() - 100, y = ScrH()/1.03, u = 1, v = 1 } -- u 1/0 = right/left
- ArmorBG[2] = { x = ScrW() - 200, y = ScrH()/1.06, u = 1, v = 0 } -- v 1/0 bottom/top
- ArmorBG[3] = { x = 200, y = ScrH()/1.06, u = 0, v = 0 }
- ArmorBG[4] = { x = 100, y = ScrH()/1.03, u = 0, v = 1 }
- local function drawHealth()
- local HealthDR = math.Clamp((ScrW()/100)*LocalPlayer():Health(), 0, ScrW())
- render.SetScissorRect( ScrW()/2 - HealthDR/2, ScrH()/1.05, ScrW()/2 + HealthDR/2, ScrH(), true )
- -- surface.SetDrawColor( 200, 0, 0, 255 )
- -- surface.SetTexture( surface.GetTextureID( "Jax/red" ) )
- -- surface.SetMaterial( Material( "Jax/red" ) )
- surface.DrawPoly( HealthBG )
- render.SetScissorRect( 0, 0, 0, 0, false )
- draw.DrawText( "Health: "..LocalPlayer():Health(), "JaxHUDFont", ScrW()/2, ScrH()/1.025, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- end
- local function drawArmor()
- local ArmorDR = math.Clamp((ScrW() - 200)/100*LocalPlayer():Armor(), 0, ScrW() - 200)
- render.SetScissorRect( (ScrW()/2) - ArmorDR/2, ScrH()/1.1, (ScrW()/2) + ArmorDR/2, ScrH(), true )
- -- surface.SetTexture( surface.GetTextureID( "Jax/gradient" ) )
- -- surface.SetDrawColor( 0, 0, 200, 255 )
- surface.DrawPoly( ArmorBG )
- render.SetScissorRect( (ScrW()/2) - ArmorDR/2, ScrH()/1.1, (ScrW()/2) + ArmorDR/2, ScrH(), false )
- draw.DrawText( "Armor: "..LocalPlayer():Armor(), "JaxHUDFont", ScrW()/2, ScrH()/1.06, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- end
- timer.Simple( 1, function()
- local avatar = vgui.Create( "AvatarImage" )
- avatar:SetSize( 64, 64 )
- avatar:SetPos( 68, ScrH()/1.13 )
- avatar:SetPlayer( LocalPlayer(), 64 )
- end )
- local function getMoney()
- return LocalPlayer():getDarkRPVar("money") or 0
- end
- -- local leftTriBG = {}
- -- leftTriBG[1] = { x = ScrW() - 200, y = ScrH()/1.1, u = 0, v = 0 }
- -- leftTriBG[2] = { x = ScrW(), y = ScrH()/1.1, u = 1, v = 0 }
- -- leftTriBG[3] = { x = ScrW(), y = ScrH(), u = 1, v = 1 }
- function hidehud(name)
- for k, v in pairs({"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"}) do
- if name == v then return false end
- end
- end
- hook.Add("HUDShouldDraw", "HideOGHUD", hidehud)
- function GM:HUDPaint()
- surface.SetDrawColor( Color( 0, 0, 0, 100 ) )
- surface.DrawRect( 0, ScrH()/1.06, ScrW(), ScrH() )
- surface.DrawRect( ScrW() - 200, ScrH()/1.2, 200, ScrH()/9.05 )
- surface.DrawRect( 0, ScrH()/1.2, 200, ScrH()/9.05 )
- surface.DrawRect( 200, ScrH()/1.09, ScrW() - 400, ScrH()/37 )
- draw.DrawText( "$"..getMoney(), "JaxHUDFont", 100, ScrH()/1.17, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.DrawText( LocalPlayer():Nick(), "JaxHUDFont", 100, ScrH()/1.2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.DrawText( team.GetName( LocalPlayer():Team() ), "JaxHUDFont", ScrW()/4, ScrH()/1.09, team.GetColor( LocalPlayer():Team() ), TEXT_ALIGN_CENTER )
- draw.DrawText( "FPS: "..math.floor(1/FrameTime()), "JaxHUDFont", ScrW()/4+ScrW()/2, ScrH()/1.09, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.NoTexture()
- surface.SetDrawColor( 200, 0, 0, 255 )
- drawHealth()
- surface.SetDrawColor( 0, 0, 200, 255 )
- drawArmor()
- if IsValid( LocalPlayer():GetActiveWeapon() ) then
- draw.DrawText( LocalPlayer():GetActiveWeapon():GetPrintName(), "JaxHUDFont", ScrW() - 100, ScrH()/1.2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.DrawText( "Primary Ammo: "..LocalPlayer():GetActiveWeapon():Clip1().."/"..LocalPlayer():GetAmmoCount( LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType() ), "JaxHUDFont", ScrW() - 100, ScrH()/1.17, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.DrawText( "Secondary Ammo: "..LocalPlayer():GetActiveWeapon():Clip2().."/"..LocalPlayer():GetAmmoCount( LocalPlayer():GetActiveWeapon():GetSecondaryAmmoType() ), "JaxHUDFont", ScrW() - 100, ScrH()/1.14, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- local kWid,kHei = killicon.GetSize( LocalPlayer():GetActiveWeapon():GetClass() )
- killicon.Draw( ScrW() - 100, ScrH()/1.09, LocalPlayer():GetActiveWeapon():GetClass(), 255 )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement