Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*---------------------------------------------------------------------------
- The Custom HUD
- only draws health
- ---------------------------------------------------------------------------*/
- if ( SERVER ) then
- AddCSLuaFile( "cl_hudreplacement.lua" )
- end
- surface.CreateFont( "HParmor", {
- font = "Gnuolane RG",
- size = 20,
- weight = 0,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false
- } )
- surface.CreateFont( "wallet", {
- font = "Gnuolane RG",
- size = 40,
- weight = 0,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false
- } )
- surface.CreateFont( "salary", {
- font = "Gnuolane RG",
- size = 25,
- weight = 0,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false
- } )
- surface.CreateFont( "name", {
- font = "Gnuolane RG",
- size = 30,
- weight = 0,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false
- } )
- local Health = 0
- function hidehud(name)
- for k, v in pairs{"CHudHealth", "CHudBattery", "CHudSecondaryAmmo", "CHudAmmo"} do
- if name == v then return false end
- end
- end
- hook.Add("HUDShouldDraw", "hidehud", hidehud)
- local function hudPaint()
- local height = 40
- local ply = LocalPlayer()
- local hp = ply:Health()
- local job = ply:Team()
- local armor = ply:Armor()
- --local job = LocalPlayer().DarkRPVars.job
- --local wallet = LocalPlayer().DarkRPVars.money
- --local salary = LocalPlayer().DarkRPVars.salary
- local name = ply:Nick()
- -- math.Clamp( hp, 0, 100 )*2.8
- -- draw.RoundedBox( Number Bordersize, Number X, Number Y, Number Width, Number Height, Color Color )
- -- Health Box
- draw.RoundedBox( 1, 23, ScrH() - height - 0, 400, 20, Color( 36, 36, 36, 255)) -- Health Background
- draw.RoundedBox( 0, 25, 1042, math.Clamp( hp, 0, 100 )*3.96, 16, Color( 230, 62, 62, 255)) -- Health Front
- -- Armour Box
- draw.RoundedBox( 1, 23, ScrH() - height - 42, 400, 20, Color( 36, 36, 36, 255)) -- Armour Background
- draw.RoundedBox( 0, 25, 1000, math.Clamp( armor, 0, 100 )*3.96, 16, Color( 51, 105, 163, 255)) -- Health Front
- -- Text Draws
- draw.DrawText(hp, "HParmor", 205, 1040, Color(255, 255, 255, 255 )) -- Heath Text
- draw.DrawText(armor, "HParmor", 205, 998, Color(255, 255, 255, 255 )) -- Armor Text
- --draw.DrawText(salary, "salary", 80, 950, Color(255, 255, 255, 255 )) -- Salary Number
- -- draw.DrawText("Salary:", "salary", 25, 950, Color(255, 255, 255, 255 )) -- Salary Text
- --draw.DrawText("$", "salary", 72, 950, Color(255, 255, 255, 255 )) -- Salary $ sign
- end
- hook.Add("HUDPaint", "DarkRP_Mod_HUDPaint", hudPaint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement