Table Inventory
Inventory manipulation
Functions
GiveItem(objectID[, count][, addToPickupSummary]) | Add an item to the player's inventory. |
TakeItem(Object[, count]) | Remove an item from the player's inventory. |
GetItemCount(objectID) | Get the amount of an item held in the player's inventory. |
SetItemCount(objectID, count) | Set the amount of an item in the player's inventory. |
Functions
- GiveItem(objectID[, count][, addToPickupSummary])
-
Add an item to the player's inventory.
Parameters:
- objectID ObjID Object ID of the item to add.
- count int The amount of items to add. Default is the yield from a single pickup, e.g. 1 from a medipack, 12 from a flare pack. (optional)
- addToPickupSummary bool If true, display the item in the pickup summary. Default is false. (optional)
- TakeItem(Object[, count])
-
Remove an item from the player's inventory.
Parameters:
- Object ObjID ID of the item to remove.
- count int The amount of items to remove. Default is the yield from a single pickup, e.g. 1 from a medipack, 12 from a flare pack. (optional)
- GetItemCount(objectID)
-
Get the amount of an item held in the player's inventory.
Parameters:
- objectID ObjID Object ID of the item to check.
Returns:
-
int
The amount of items. -1 indicates infinity.
- SetItemCount(objectID, count)
-
Set the amount of an item in the player's inventory.
Parameters:
- objectID ObjID Object ID of the item amount to set.
- count int The amount of items to set. -1 indicates infinity.