GiveInventory (Actor)

From ZDoom Wiki
Jump to navigation Jump to search

bool GiveInventory (class<Inventory> type, int amount [, bool givecheat])

Usage

Adds amount items of type type to the calling actor's inventory. This function will not add more items than can be carried.

If type is an armor item, be it a pickup or a bonus, then amount is treated as a multiplier to the item's save amount, e.g. if type is BlueArmor and amount is 3, then a combat armor with 600 armor points is given.

Parameters

  • type: the class name of the item to give. This should be a valid inventory item.
  • amount: the number of samples of this item to give.
  • givecheat: if true, treats the item as being given by the give console command. Default is false.

Return value

The function returns true if the item is successfully received, otherwise it returns false.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.