Basically made this in about 60 Minutes for someone.
But how would i make it fit any resolution i had a few people say it was messed up for them. I know that I have to use ScrW() and ScrH() but i'm not sure about how I can implement it properly.
But how would i make it fit any resolution i had a few people say it was messed up for them. I know that I have to use ScrW() and ScrH() but i'm not sure about how I can implement it properly.
Code:
--Removes the basic Garry's Mod hud.
hook.Add( "HUDShouldDraw", "hide hud", function( name )
if ( name == "CHudHealth" or name == "CHudBattery" or name == "CHudAmmo" ) then
return false
end
end )
local function myhud()
draw.RoundedBox( 0, 0, 0, ScrW(), 33, Color( 20, 20, 20,200 ) )
local health = LocalPlayer():Health()
local armor = LocalPlayer():Armor()
local name = LocalPlayer():Nick()
----------
--Name--
----------
draw.RoundedBox( 3, 1, 1, 304, 29, Color( 0, 100, 149 ) )
draw.RoundedBox( 3, 3, 3, 300, 25, Color( 0, 170, 164 ) )
draw.SimpleText( "Name: "..name.."","NeonFont", 10 + 142, 10 + 6, Color( 255, 255, 255 ), 1, 1 )
----------
--Health--
----------
draw.RoundedBox( 3, ScrW() - 1610, 1, 304, 29, Color( 102, 49, 49 ) )
draw.RoundedBox( 3, ScrW() - 1608, 3, health * 3, 25, Color( 209, 96, 96 ) )
draw.SimpleText( "Health ("..health.."%)","NeonFont", 10 + 450, 10 + 6, Color( 255, 255, 255 ), 1, 1 )
--------
--Armor--
--------
draw.RoundedBox( 3, ScrW() - 1302, 1, 304, 29, Color( 49, 49, 102 ) )
draw.RoundedBox( 3, ScrW() - 1300, 3, armor * 3, 25, Color( 96, 96, 209 ) )
draw.SimpleText( "Armor ("..armor.."%)","NeonFont", 10 + 750, 10 + 6, Color( 255, 255, 255 ), 1, 1 )
---------
--Money--
---------
draw.RoundedBox( 3, ScrW() - 994, 1, 304, 29, Color( 49, 102, 49), 1, 1)
draw.RoundedBox( 3, ScrW() - 992, 3, 300, 25, Color( 96, 209, 96), 1, 1)
draw.SimpleText( "Money: $"..LocalPlayer():getDarkRPVar( "money" ).."","NeonFont", 10 + 1050, 10 + 6, Color( 255, 255, 255 ), 1, 1 )
----------
--Salary--
----------
draw.RoundedBox( 3, ScrW() - 686, 1, 304, 29, Color( 102, 49, 102), 1, 1)
draw.RoundedBox( 3, ScrW() - 684, 3, 300, 25, Color( 209, 96, 209), 1, 1)
draw.SimpleText( "Salary: $"..LocalPlayer():getDarkRPVar( "salary" ).."","NeonFont", 10 + 1350, 10 + 6, Color( 255, 255, 255 ), 1, 1 )
---------
--Jobs--
---------
draw.RoundedBox( 3, ScrW() - 378, 1, 304, 29, Color( 96, 49, 102), 1, 1)
draw.RoundedBox( 3, ScrW() - 376, 3, 300, 25, Color( 96, 49, 209), 1, 1)
draw.SimpleText( "Job: "..LocalPlayer():getDarkRPVar( "job" ).."","NeonFont", 10 + 1650, 10 + 6, Color( 255, 255, 255 ), 1, 1 )
---------------
--Server-Name--
---------------
draw.RoundedBox( 3, ScrW() - 70, 1, 200, 29, Color( 20, 20, 20), 1, 1)
draw.RoundedBox( 3, ScrW() - 66, 3, 150, 25, Color( 80, 80, 80), 1, 1)
draw.SimpleText( "N - RP", "NeonFont", 10 + 1880, 10 + 6, Color( 255, 255, 255),1 ,1 )
end
surface.CreateFont( "NeonFont", {
font = "Arial",
extended = false,
size = 22,
weight = 500,
blurzize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = true,
} )