Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2319,6 +2319,16 @@ public void Broadcast(ushort duration, string message, global::Broadcast.Broadca
public void AddAmmo(AmmoType ammoType, ushort amount) =>
Inventory.ServerAddAmmo(ammoType.GetItemType(), amount);

/// <summary>
/// Adds the amount of a specified <see cref="AmmoType">ammo type</see> to player's inventory.
/// </summary>
/// <param name="ammoBag">A dictionary of <see cref="AmmoType">ammo types</see> that will be added.</param>
public void AddAmmo(Dictionary<AmmoType, ushort> ammoBag)
{
foreach (KeyValuePair<AmmoType, ushort> kvp in ammoBag)
AddAmmo(kvp.Key, kvp.Value);
}

/// <summary>
/// Adds the amount of a weapon's <see cref="AmmoType">ammo type</see> to the player's inventory.
/// </summary>
Expand All @@ -2338,6 +2348,16 @@ public void SetAmmo(AmmoType ammoType, ushort amount)
Inventory.ServerSetAmmo(itemType, amount);
}

/// <summary>
/// Sets the amount of a specified <see cref="AmmoType">ammo type</see> to player's inventory.
/// </summary>
/// <param name="ammoBag">A dictionary of <see cref="AmmoType">ammo types</see> that will be added.</param>
public void SetAmmo(Dictionary<AmmoType, ushort> ammoBag)
{
foreach (KeyValuePair<AmmoType, ushort> kvp in ammoBag)
SetAmmo(kvp.Key, kvp.Value);
}

/// <summary>
/// Gets the ammo count of a specified <see cref="AmmoType">ammo type</see> in a player's inventory.
/// </summary>
Expand Down