Is it possible to delete all of the items in a players inventory, no matter what the item is?
I am thinking of just using the "LoseInventory" function for each item, but the thing is I can't be certain what all items will be in the inventory at a certain time.
What is the best way to do this? Thanks
int j = 0;
while (j < (Game.InventoryItemCount ))
{
cEgo.LoseInventory(inventory[ j ]);
j++;
}
InventoryItem numbering starts at 1, not 0.
Plus, if the player is able to pick up more than one of one or more items, you need to remove every single one.
You can add an inner loop, or do this:
int j = 1;
while (j <= Game.InventoryItemCount)
{
player.InventoryQuantity[j] = 0;
j++;
}
UpdateInventory(); // changing .InventoryQuantity requires manually updating the inventory GUI
Quote from: Khris on Tue 19/01/2016 13:52:59
InventoryItem numbering starts at 1, not 0.
Wouldn't it be easy to just delete the complete inventory with
cEgo.LoseInventory(0);
Should I add this to the feature requests or are there possible complications?
Quote from: selmiak on Tue 19/01/2016 18:34:35
Wouldn't it be easy to just delete the complete inventory with
cEgo.LoseInventory(0);
Should I add this to the feature requests or are there possible complications?
LoseInventory takes pointer, not index number.
As for deleting all there should better be a separate function. Using nullpointer to delete everything is a bit counter-intuitive.
Ok thanks!