bool Character.HasInventory(InventoryItem *item)
Checks whether the character currently has the specified inventory item.
Returns true if they do, or false if they don't.
The parameter is the inventory item's Script O-Name from the editor (for
example, iPoster).
Example:
if (player.HasInventory(iKey))
{
Display("The player has the key!!");
}
will display a message if the player has the key.
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: Character.AddInventory,
Character.InventoryQuantity,
Character.LoseInventory
|