I have been making a hid for a while, and its been hard, but i finally under stood ScrW() And ScrH() but how can i make it display ammo and weapon name?
Drawing a players name:
[CODE]
hook.Add("HudPaint", "AnyName", function(ply)
draw.WordBox( 4, 30, ScrH() - 175, "Your Name Is " .. ply:Nick(), "ChatFont", Color( 0, 0, 0, 0 ), Color ( 0, 0, 255, 255 ) )[/CODE]
Drawing Ammo:
[CODE]function hud()
local health = LocalPlayer():Health()
local weapon = LocalPlayer():weapon:Clip1()
draw.RoundedBox( 0, 10, 740, 300, 50, Color( 0, 0, 0, 200 ) )
draw.RoundedBox( 0, 10, 680, 300, 50, Color( 0, 0, 0, 200 ) )
draw.RoundedBox( 0, 10, 680, math.Clamp(health ,0, 200)*3, 50, Color( 0, 0, 0, 210 ) )
draw.RoundedBox( 0, 10, 680, math.Clamp(health ,0, 200)*3, 50, Color( 0, 0, 0, 210 ) )
draw.SimpleText("Health:", "Default", 15, ScrH() - 60 - 40, Color(255,255,255,255))
draw.SimpleText("Ammo:", "Default", 15, ScrH() - 5 - 40, Color(255,255,255,255))
draw.SimpleText(health, "default", 145, ScrH() - 60 - 40, Color(255,255,255,255))
draw.SimpleText(weapon, "default", 150, ScrH() - 60 - 40, Color(255,255,255,255))
end
hook.Add("HUDPaint", "MyHudName", hud)
-- Hide Original Hud --
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", "HideOurHud:D", hidehud)[/CODE]
Maybe use the [URL="http://wiki.garrysmod.com/page/Main_Page"]GMOD wiki[/URL] instead of asking other people, youl never learn anything from copying and pasting
Thanks, also i look at the wiki just, i find people can explain it better :P
Sorry, you need to Log In to post a reply to this thread.