• Ammo counter disappears whenever hungermod energy counter is enabled?
    2 replies, posted
What's happenin' forum? I'm currently making a DarkRP HUD, and I made an if statement that disables the DarkRP energy counter if hungermod is enabled in my HUD's config. However, whenever hungermod is enabled in the config, the ammo counter disappears. Sorry if this is an obvious solution, I'm not too experienced in GLua. if HMEnabled == true then -- Enables HM energy counter whenever it's set to true in the config         draw.SimpleText(energy.."%", "HealthFont", ScrH() - 560, 830, Color(234, 156, 0), 0, 0)         surface.SetDrawColor( 255, 255, 255, 255 )         surface.SetMaterial(energy_icon) -- If you use Material, cache it!         surface.DrawTexturedRect( ScrW() - 1310, ScrH() - 70, 60, 60 )         return     end if disabled then return end -- Hides the ammo counter if the user is holding a weapon that doesn't need ammo (e.g. Physgun) draw.SimpleText(ammo.."", "AmmoPrimary", ScrW() - 200, ScrH() - 75, Color(234, 156, 0), 0, 0) draw.SimpleText(reserve.."", "AmmoSecondary", ScrW() - 110, ScrH() - 75, Color(234, 156, 0), 0,0) draw.RoundedBox(0, ScrW() - 130, ScrH() - 69, 3, 50, Color(234, 156, 0))
the "return" in the first if statement is jumping out of the function too soon. get rid of that return and it should be good. ~90% confident.
That worked! Thanks for the help, Swept.
Sorry, you need to Log In to post a reply to this thread.