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.Action
2<BasePlayer,Item> onCurrencyRemoved, System.Action
2<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];
//---