disable ammo hud

Hello, what is the code to disable ammo hud

First example of


You already know how to do this why are you asking?

no i d’ont know

[editline]2nd October 2017[/editline]

what is the specific code for ammo , i don’t find

Oh, sorry. I thought it included that.

local hide = {
	CHudAmmo = true,
	CHudSecondaryAmmo = true,

hook.Add( "HUDShouldDraw", "HideHUD", function( name )
	if hide[ name ] then return false end
end )

EDIT: Why the dumb rating? I meant in the example.

very thank’s

[lua]local wep, total, clip, nicename
local function Ammo()
ply = LocalPlayer()
if !IsValid(ply:GetActiveWeapon()) then return end
wep = ply:GetActiveWeapon()
total = ply:GetAmmoCount(wep:GetPrimaryAmmoType())
clip = wep:Clip1()
nicename = wep:GetPrintName()

if clip < 0 or wep:GetClass() == “weapon_physcannon” then return end

draw.SimpleText(clip,“phona_ammo”,ScrW() - 180,ScrH() - 100,Color(0,0,0),TEXT_ALIGN_CENTER)
draw.SimpleText(total,“phona_ammo”,ScrW() - 90,ScrH() - 100,Color(0,0,0),TEXT_ALIGN_CENTER)
draw.SimpleText(“clip”,“phona_ammo2”,ScrW() - 180,ScrH() - 70,Color(0,0,0),TEXT_ALIGN_CENTER)
draw.SimpleText(“Reserved”,“phona_ammo2”,ScrW() - 90,ScrH() - 70,Color(0,0,0),TEXT_ALIGN_CENTER)
my hud does not work

You aren’t adding the [del]DrawHUD[/del] HUDPaint hook.

Going a little more in-depth on what code_gs said, rendering functions generally must be called at least once or more per frame on the client and the way to do this is to put it around a rendering hook like


Going a little more mentally insane on what MelonShooter said, rendering functions are called by the Source Engine once or more per frame, and the content drawn on screen from these calls can be modified using a rendering hook such as