I am making this hud and now I am adding in the ammo part of it. I cant find a good solution for the thing.
This is what I have come up with:
if( client:Alive() ) then
for k, v in pairs( ammohud_denyweps ) do
end
local tablething = table.HasValue( almtech_ammohud_denyweps, k )
if( not client:GetActiveWeapon():GetClass() == tablething ) then
-- Draw the hud thing
else
-- Dont draw the hud thing
end
end
The table:
ammohud_denyweps = {
["gmod_tool"] = true,
["weapon_fists"] = true,
["weapon_physgun"] = true,
["gmod_camera"] = true
}
My problem is that the hud appears even if I am holding any weapon in the table. Please help
["gmod_tool"] = true
-- ^ key ^ value
-- How do you think table.HasValue works?
local wep = client:GetActiveWeapon()
if IsValid(wep) and ammohud_denyweps[wep:GetClass()] then
-- Draw the hud thing
end
Sorry, you need to Log In to post a reply to this thread.