# Sandbox.BaseInventoryComponent.SetAmmo

```csharp
void SetAmmo(BaseAmmoResource type, int amount)
```

Set the reserve ammo of the given type to an exact value (clamped to zero). Ignores the
type's max - the escape hatch for game logic that wants to exceed it.

### Parameters

- `type` (`BaseAmmoResource`)
- `amount` (`int`)

Declared in [Sandbox.BaseInventoryComponent](/api/Sandbox.BaseInventoryComponent).
Assembly: `Sandbox.Engine`.
