1. Rebajas

    Rebajas Wood Hoarder


    Another quick question regarding vending machines - I'd love to know if the status of the broadcast is available in OnToggleVendingBroadcast so I can do a chat broadcast when a machine is made newly available...

    Thanks in advance,

  2. JoeSheep

    JoeSheep Master Researcher Plugin Developer

    Never done anything with vending machines, but checking the value of the following bool should give you what you want:
    Code (C):

    machine being what ever your VendingMachine parameter is named.
  3. Mughisi

    Mughisi Grenade Master Community Mod Oxide Developer

    `globalBroadcast` is not the broadcasting of the vendingmachine but the actual networking of the object.

    @Rebajas: The VendingMachine has the method `public bool IsBroadcasting()` which you can use to get the broadcasting status of the vendingmachine.
    Code (C#):
    private void OnToggleVendingBroadcast(VendingMachine machine, BasePlayer player)
        bool enabled = machine.IsBroadcasting();
    JoeSheep likes this.
  4. Rebajas

    Rebajas Wood Hoarder

    Nice one - worked perfectly... :)