Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- --HUD--
- ---------------------------------------------------------------------------
- surface.CreateFont( "Hud", {
- font = "coolvetica rg", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
- extended = false,
- size = 18,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false,
- } )
- hook.Add("HUDPaint" , "DrawHUD", function()
- local health = LocalPlayer():Health()
- local armor = LocalPlayer():Armor()
- local ply = LocalPlayer()
- draw.RoundedBox(0,10,ScrH() -150,350,140,Color(32,32,32,230))
- draw.RoundedBox(0,10,ScrH() -155,350,25,Color(66,139,202))
- draw.SimpleText(ply:Nick(),"Hud",10,100,150,Color(255,255,255))
- draw.RoundedBox(0,155,ScrH() -80,200,25,Color(32,32,32,200))
- draw.RoundedBox(0,155,ScrH() -80,health * 2,25,Color(255,51,51))
- draw.SimpleText(health.." Health","Hud",230,ScrH() -78,Color(255,255,255))
- draw.RoundedBox(0,155,ScrH() -50,200,25,Color(32,32,32,200))
- draw.RoundedBox(0,155,ScrH() -50,health * 2,25,Color(0,128,255))
- draw.SimpleText(armor.." Armor","Hud",230,ScrH() -48,Color(255,255,255))
- end)
- local icon = vgui.Create("DModelPanel")
- icon:SetSize(100,100)
- icon:SetPos(0,ScrH() - (120 - 5))
- icon:SetModel(LocalPlayer():GetModel())
- function icon:LayoutEntity(Entity) return end
- function icon.Entity:GetPlayerColor() return Vector(1,0,0) end
- icon:SetFOV(10)
- icon:SetCamPos(Vector(90,-20,70))
- icon:SetLookAt(Vector(0,0,65))
- icon.Entity:SetEyeTarget(Vector(200, 200, 100))
- timer.Create("UpdateIcon",0.5, 0,function()
- if icon:IsValid() and LocalPlayer():GetModel() != icon.Entity:GetModel() then
- icon:SetModel(LocalPlayer():GetModel())
- end
- end)
- local hide =
- {
- ["CHudHealth"] = true,
- ["CHudBattery"] = true
- }
- hook.Add( "HUDShouldDraw", "HideHUD", function( name )
- if ( hide[name] ) then return false end
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement