Player:GetAmmoCount
Description
Gets the amount of ammo the player has.
Arguments
Returns
Example
A function that returns the ammo for the weapon the player is currently holding.
function GetAmmoForCurrentWeapon( ply )
if ( !IsValid( ply ) ) then return -1 end
local wep = ply:GetActiveWeapon()
if ( !IsValid( wep ) ) then return -1 end
return ply:GetAmmoCount( wep:GetPrimaryAmmoType() )
end
Output: 31