Skip to content

CanPurchaseItem

Usage

  • Return a bool value to override default behavior

Example Autogenerated

csharp
private bool? CanPurchaseItem( BasePlayer buyer, Item item, Action<BasePlayer, Item> onItemPurchased, VendingMachine instance, ItemContainer targetContainer )
{
    Puts( "CanPurchaseItem works!" );
    return null;
}

Location

  • VendingMachine::DoTransaction(BasePlayer buyer, int sellOrderId, int numberOfTransactions, ItemContainer targetContainer, Action<BasePlayer, Item> onCurrencyRemoved, Action<BasePlayer, Item> onItemPurchased, MarketTerminal droneMarketTerminal)
csharp
//---
			Debug.LogError("Vending machine error, contact developers!");
		}
		else
		{
			num9 += item4.amount;
			object obj3 = Interface.CallHook("CanPurchaseItem", buyer, item4, onItemPurchased, this, targetContainer);
			if (obj3 != null)
			{
				if (!(obj3 is bool))
				{
					return false;
//---

Released under the MIT License.