1. Oxide for Rust Legacy has been discontinued and is no longer supported. No updates or additions will be made, and Rust Legacy-specific plugin submissions will no longer be accepted. We recommend upgrading to the latest version of Rust as able.
    Dismiss Notice

OnItemUse hook?

Discussion in 'Legacy Development' started by S1LV4, Dec 4, 2017.

  1. S1LV4

    S1LV4 Naked Wanderer

    Has a hook to show if the item was used.
     
  2. Jakkee

    Jakkee Plugin Developer

    What item?
     
  3. S1LV4

    S1LV4 Naked Wanderer

    Example : Supply Signal
     
  4. Jakkee

    Jakkee Plugin Developer

    I dont think there is a hook for that, You could maybe do a work around:
    Code (Text):
    private AirDropCalledIn = False;

    void OnAirdrop(Vector3 position)
    {
        if (AirDropCalledIn)
        {
            AirDropCalledIn = False;
            //Airdrop has been called in, Do something here
        }
    }

    void OnItemRemoved(Inventory inventory, int slot, IInventoryItem item)
    {
        if(item.datablock.Datablock.Ident.name == "Supply Signal")
        {
            AirDropCalledIn = True;
        }
    }
    --- Double Post Merged, Dec 7, 2017 at 1:11 AM ---
    or maybe you're just looking for OnItemRemoved?
    But I think if you drop an item out of inventory it'll set off the OnItemRemoved.
    You'd have to add checks
     
  5. S1LV4

    S1LV4 Naked Wanderer

    @Jakkee
    Maybe it works, Thanks!