Table Inventory
Inventory manipulation
Functions
GiveItem(item, count) | Add x of an item to the inventory. |
GetItemCount(item) | Get the amount the player holds of an item. |
SetItemCount(item, count) | Set the amount of a certain item the player has in the inventory. |
Functions
- GiveItem(item, count)
-
Add x of an item to the inventory.
A count of 0 will add the "default" amount of that item
(i.e. the amount the player would get from a pickup of that type).
For example, giving "zero" crossbow ammo would give the player
10 instead, whereas giving "zero" medkits would give the player 1 medkit.
Parameters:
- item InvID the item to be added
- count int the number of items to add (default: 0)
- GetItemCount(item)
-
Get the amount the player holds of an item.
Parameters:
- item InvID the ID item to check
Returns:
-
int
the amount of the item the player has in the inventory
- SetItemCount(item, count)
-
Set the amount of a certain item the player has in the inventory.
Similar to GiveItem but replaces with the new amount instead of adding it.
Parameters:
- item the ID of the item to be set
- count int the number of items the player will have