CStartInventory

Player start inventory manager
Can be used to modify the player's start inventory during a map
Always check if inventory modification is available before trying to make any changes

Type: Reference type

Methods

Declaration Description
bool IsAvailable() const Returns whether inventory modification is available.
bool Exists(const string& in szEntry) const Returns whether the given entry is present in the inventory.
void Set(const string& in szItem, uint uiAmount) Set an item in the inventory.
Sets the amount if the item is already in the inventory.
void Set(const string& in szEntry) Set an entry to the inventory.
bool Add(const string& in szEntry, uint uiAmount, bool fAdd = true) Add or subtract from an existing value.
Inserts if the value is not already in the inventory.
bool Remove(const string& in szEntry) Removes an entry from the inventory.
bool Restock(const string& in szItem, uint uiAmount) Restocks the inventory with up to uiAmount of the given item.
Does nothing if the current amount already exceeds the given amount.
bool Limit(const string& in szItem, uint uiAmount) Limits the inventory content of the given item to at most uiAmount.
Does nothing if there is less than uiAmount in the inventory.
uint GetAmount(const string& in szEntry) const Gets the amount of a given entry.
Returns 0 if the entry doesn't exist.