A_GiveInventory

From ZDoom Wiki
Revision as of 17:01, 19 August 2011 by FDARI (talk | contribs) (Removed pointer information. Added reference to better information.)
Jump to navigation Jump to search

A_GiveInventory (string type, int count)
A_GiveInventory (string type, int count[, pointer giveto]) (development version r3167+ only)


Tries to add count items of type type to the calling actor's inventory. This function will not add more items than can be carried. This is only really useful for weapons and Custom Inventory.

Giveto is an optional Actor pointer selector.

Examples

actor BigBoost : CustomInventory 10492
{
  inventory.pickupmessage "Energy Boost!!!"
  inventory.pickupsound "misc/p_pkup"
  +COUNTITEM
  states
  {
  Spawn:
    AWI3 A -1
    stop
  Pickup:
    TNT1 A 0 A_GiveInventory ("Soulsphere", 2)
    TNT1 A 0 A_GiveInventory ("BFG9000")
    stop
  }
}

This actor gives two inventory items with one pickup using A_GiveInventory.