Vending (23)

All currently available hooks that are found in Carbon. Most hooks would be ones compatible with Oxide, although there are Carbon-only ones as well.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MarketTerminal.g__IsEligible|42_0 of Assembly-CSharp.dll.

Example
object CanAccessVendingMachine(MarketTerminal self, VendingMachine vendingMachine)
{
    Puts("CanAccessVendingMachine was called!");
    return (bool) null;
}
  • Called when a player attempts to administer a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.CanPlayerAdmin of Assembly-CSharp.dll.

Example
object CanAdministerVending(BasePlayer player, VendingMachine self)
{
    Puts("CanAdministerVending was called!");
    return (bool) null;
}
  • Called when a player attempts to administer a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches NPCVendingMachine.CanPlayerAdmin of Assembly-CSharp.dll.

Example
object CanAdministerVending(BasePlayer player, NPCVendingMachine self)
{
    Puts("CanAdministerVending was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.DoTransaction of Assembly-CSharp.dll.

Example
object CanPurchaseItem(BasePlayer buyer, Item local13, System.Action`2[[BasePlayer, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[Item, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] onItemPurchased, VendingMachine self, ItemContainer targetContainer)
{
    Puts("CanPurchaseItem was called!");
    return (bool) null;
}

This hook requires OnVendingTransaction, which loads alongside CanPurchaseItem.

  • Called when a player attempts to use a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.CanOpenLootPanel of Assembly-CSharp.dll.

Example
object CanUseVending(BasePlayer player, VendingMachine self)
{
    Puts("CanUseVending was called!");
    return (bool) null;
}
  • Called when a player attempts to administer a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.CanAcceptItem of Assembly-CSharp.dll.

Example
object CanVendingAcceptItem(VendingMachine self)
{
    Puts("CanVendingAcceptItem was called!");
    return (bool) null;
}
  • Called when a sell order/offer is added to a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.AddSellOrder of Assembly-CSharp.dll.

Example
void OnAddVendingOffer(VendingMachine self, ProtoBuf.VendingMachine.SellOrder local2)
{
    Puts("OnAddVendingOffer was called!");
}
  • Called when a player buys an item from a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.BuyItem of Assembly-CSharp.dll.

Example
object OnBuyVendingItem(VendingMachine self, BasePlayer player, int local0, int local1)
{
    Puts("OnBuyVendingItem was called!");
    return (object) null;
}
  • Called when a sell order/offer is deleted from a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.RPC_DeleteSellOrder of Assembly-CSharp.dll.

Example
void OnDeleteVendingOffer(VendingMachine self, int local1)
{
    Puts("OnDeleteVendingOffer was called!");
}
  • Called before a sold item is given.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.GiveSoldItem of Assembly-CSharp.dll.

Example
object OnGiveSoldItem(VendingMachine self, Item soldItem, BasePlayer buyer)
{
    Puts("OnGiveSoldItem was called!");
    return (object) null;
}
  • Called before making a purchase at the Marketplace terminal.

  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches MarketTerminal.Server_Purchase.

Example
object OnMarketplaceTerminalPurchase(MarketTerminal terminal, VendingMachine vending, BasePlayer player, int sellOrderIndex, int amount)
{
    Puts("OnMarketplaceTerminalPurchase was called!");
    return (bool) null;
}
  • Called when a player opens the admin ui for a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.RPC_OpenAdmin of Assembly-CSharp.dll.

Example
void OnOpenVendingAdmin(VendingMachine self, BasePlayer local0)
{
    Puts("OnOpenVendingAdmin was called!");
}
  • Called when the stock on a vending machine is updated.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.RefreshSellOrderStockLevel of Assembly-CSharp.dll.

Example
void OnRefreshVendingStock(VendingMachine self, ItemDefinition itemDef)
{
    Puts("OnRefreshVendingStock was called!");
}
  • Called when a player attempts to rotate a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.RPC_RotateVM of Assembly-CSharp.dll.

Example
object OnRotateVendingMachine(VendingMachine self, BasePlayer player)
{
    Puts("OnRotateVendingMachine was called!");
    return (object) null;
}
  • Called before currency item is taken.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.TakeCurrencyItem of Assembly-CSharp.dll.

Example
object OnTakeCurrencyItem(VendingMachine self, Item takenCurrencyItem)
{
    Puts("OnTakeCurrencyItem was called!");
    return (object) null;
}
  • Called before currency item is taken.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches NPCVendingMachine.TakeCurrencyItem of Assembly-CSharp.dll.

Example
object OnTakeCurrencyItem(NPCVendingMachine self, Item takenCurrencyItem)
{
    Puts("OnTakeCurrencyItem was called!");
    return (object) null;
}
  • Called when a player toggles the broadcasting of the vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.RPC_Broadcast of Assembly-CSharp.dll.

Example
void OnToggleVendingBroadcast(VendingMachine self, BasePlayer local0)
{
    Puts("OnToggleVendingBroadcast was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.RPC_OpenShop of Assembly-CSharp.dll.

Example
object OnVendingShopOpen(VendingMachine self, BasePlayer player)
{
    Puts("OnVendingShopOpen was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches NPCTalking.OnConversationAction of Assembly-CSharp.dll.

Example
object OnVendingShopOpen(InvisibleVendingMachine local1, BasePlayer player)
{
    Puts("OnVendingShopOpen was called!");
    return (object) null;
}
  • Called when a player opens the customer ui for a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.RPC_OpenShop of Assembly-CSharp.dll.

Example
void OnVendingShopOpened(VendingMachine self, BasePlayer player)
{
    Puts("OnVendingShopOpened was called!");
}

This hook requires OnVendingShopOpen [VendingMachine], which loads alongside OnVendingShopOpened.

  • Called when a player opens the customer ui for a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches NPCTalking.OnConversationAction of Assembly-CSharp.dll.

Example
void OnVendingShopOpened(InvisibleVendingMachine local1, BasePlayer player)
{
    Puts("OnVendingShopOpened was called!");
}

This hook requires OnVendingShopOpen [NPCTalking], which loads alongside OnVendingShopOpened.

  • Called when a player tries to rename vending shop.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.RPC_UpdateShopName of Assembly-CSharp.dll.

Example
object OnVendingShopRename(VendingMachine self, string local1, BasePlayer local0)
{
    Puts("OnVendingShopRename was called!");
    return (object) null;
}
  • Called when a player attempts to buy an item from a vending machine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VendingMachine.DoTransaction of Assembly-CSharp.dll.

Example
object OnVendingTransaction(VendingMachine self, BasePlayer buyer, int sellOrderId, int numberOfTransactions, ItemContainer targetContainer)
{
    Puts("OnVendingTransaction was called!");
    return (bool) null;
}

Last updated