A_GiveToTarget

From ZDoom Wiki
Jump to: navigation, search

A_GiveToTarget (string type, int count)
A_GiveToTarget (string type, int count[, pointer giveto])


Tries to add count items of type type to the calling actor's current target's inventory. This function will not add more items than can be carried. Note that when an actor dies its target is automatically set to the killer. Projectiles also target the player who shot them when they are fired.

If giveto is specified, then instead of the calling actor's target, the item will be added to a different actor depending on the calling actor's target's own pointers.

Examples

This function can be used to reward players with items for killing certain monsters.

Death:
  CYBR H 10 A_GiveToTarget("Credits", 1000)
  CYBR I 10 A_Scream
  CYBR JKL 10
  CYBR M 10 A_NoBlocking
  CYBR NO 10
  CYBR P 30
  CYBR P -1 A_BossDeath
  stop