Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Determine the quantity of an item in an inventory slot.
count = GetInventoryItemCount(unit, invSlotId)
Arguments[]
- unit
- string : UnitId - The unit whose inventory is to be queried.
- invSlotId
- number : InventorySlotId - to be queried, obtained via GetInventorySlotInfo.
Returns[]
- count
- number - Returns 1 on empty slots (Thus, on empty ammo slot, 1 is returned). For containers (Bags, etc.), this returns the number of items stored inside the container (Thus, empty containers return 0). Under all other conditions, this function returns the amount of items in the specified slot.
Example[]
local ammoSlot = GetInventorySlotInfo("AmmoSlot"); local ammoCount = GetInventoryItemCount("player", ammoSlot); if ((ammoCount == 1) and (not GetInventoryItemTexture("player", ammoSlot))) then ammoCount = 0; end;