Skip to content

OnVendingTransaction

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnVendingTransaction( VendingMachine instance, BasePlayer buyer, int sellOrderId, int numberOfTransactions, ItemContainer targetContainer )
{
    Puts( "OnVendingTransaction works!" );
}

Location

  • VendingMachine::DoTransaction(BasePlayer buyer, int sellOrderId, int numberOfTransactions, ItemContainer targetContainer, System.Action2&lt;BasePlayer,Item&gt; onCurrencyRemoved, System.Action2<BasePlayer,Item> onItemPurchased, MarketTerminal droneMarketTerminal)
csharp
//---
	}
	if (targetContainer == null && Vector3.Distance(buyer.transform.position, base.transform.position) > 4f)
	{
		return false;
	}
	object returnvar = Interface.CallHook("OnVendingTransaction", this, buyer, sellOrderId, numberOfTransactions, targetContainer);
	if (returnvar is bool)
	{
		return (bool)returnvar;
	}
	ProtoBuf.VendingMachine.SellOrder sellOrder = this.sellOrders.sellOrders[sellOrderId];
//---

Released under the MIT License.