Ulysses
General => Developers Corner => Topic started 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?
-
what i googled "garrys mod get armor"
what i got
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexe5e4.html
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
-
what i googled "garrys mod get armor"
what i got
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexe5e4.html
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.
-
The armour doesn't appear on the hud, neither does the name.
-
but does it error You need armor for it to show.
the name SHOULD NOT SHOW UP because its not coded xD
-
Nevermind, got one done.