Finiding max ammo?

How would i get the max ammo for the weapon your currently holding for a hud?

I don’t think there is a function to get it from the weapon or anything. All I could find on max ammo was this page from the old wiki:

Looking at this you could get the value from the convars for the max ammo.

[lua]local maxPistolAmmo = GetConVarNumber(“sk_max_pistol”)[/lua]

Nah that doesnt work :confused:

[lua]weapons.Get( ‘weapon_class’ ).Primary.ClipSize[/lua]