Skip to content

OnTakeCurrencyItem

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnTakeCurrencyItem( NPCVendingMachine instance, Item takenCurrencyItem )
{
    Puts( "OnTakeCurrencyItem works!" );
}
csharp
private void OnTakeCurrencyItem( VendingMachine instance, Item takenCurrencyItem )
{
    Puts( "OnTakeCurrencyItem works!" );
}

Location

  • NPCVendingMachine::TakeCurrencyItem(Item takenCurrencyItem)
  • VendingMachine::TakeCurrencyItem(Item takenCurrencyItem)
csharp
public override void TakeCurrencyItem(Item takenCurrencyItem)
{
	if (Interface.CallHook("OnTakeCurrencyItem", this, takenCurrencyItem) != null)
	{
		return;
	}
	takenCurrencyItem.MoveToContainer(base.inventory, -1, true, false, null, true);
	takenCurrencyItem.RemoveFromContainer();
//---
csharp
public virtual void TakeCurrencyItem(Item takenCurrencyItem)
{
	if (Interface.CallHook("OnTakeCurrencyItem", this, takenCurrencyItem) != null)
	{
		return;
	}
	if (!takenCurrencyItem.MoveToContainer(base.inventory, -1, true, false, null, true))
	{
//---

Released under the MIT License.