Ulysses

General => Developers Corner => Topic started by: Mindless on February 11, 2013, 03:01:48 AM

Title: Hud?
Post by: Mindless on February 11, 2013, 03:01:48 AM
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4ac3.html

I was following this example, but it doesn't work in DarkRP. I want the armour to show aswell but I dont know how?
Title: Re: Hud?
Post by: nathan736 on February 11, 2013, 09:51:12 AM
what i googled "garrys mod get armor"
what i got
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexe5e4.html
Code: [Select]
function DrawPlayerArmor()
          if (LocalPlayer():Armor() > 0) then
             draw.RoundedBox( 8, 32, 16, ScrW() - 64, 16, Color(200, 200, 200, 200))
             draw.RoundedBox( 8, 34, 18, (ScrW() - 68)*(LocalPlayer():Armor() / 1000), 12, Color(0, 0, 200, 200))
          end
end
hook.Add("HUDPaint","drawplayerarmor",DrawPlayerArmor)
this should work might not (at school can not test) hope i helped !
ps: THIS MIGHT ERROR IF RAN SERVER SIDE
Title: Re: Hud?
Post by: Bite That Apple on February 12, 2013, 01:13:39 AM
what i googled "garrys mod get armor"
what i got
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexe5e4.html
Code: [Select]
function DrawPlayerArmor()
          if (LocalPlayer():Armor() > 0) then
             draw.RoundedBox( 8, 32, 16, ScrW() - 64, 16, Color(200, 200, 200, 200))
             draw.RoundedBox( 8, 34, 18, (ScrW() - 68)*(LocalPlayer():Armor() / 1000), 12, Color(0, 0, 200, 200))
          end
end
hook.Add("HUDPaint","drawplayerarmor",DrawPlayerArmor)
this should work might not (at school can not test) hope i helped !
ps: THIS MIGHT ERROR IF RAN SERVER SIDE

I believe that can be used serverside, seeing as on that website it say's Blue/Orange, which I would assume it means Client/Server or shared.
Title: Re: Hud?
Post by: Mindless on February 12, 2013, 03:34:48 PM
The armour doesn't appear on the hud, neither does the name.
Title: Re: Hud?
Post by: nathan736 on February 15, 2013, 07:53:04 AM
but does it error You need armor for it to show.
the name SHOULD NOT SHOW UP because its not coded xD
Title: Re: Hud?
Post by: Mindless on February 15, 2013, 10:59:44 AM
Nevermind, got one done.