Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OnInventoryItemFind hook #534

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

WheteThunger
Copy link
Contributor

Item OnInventoryItemFind(PlayerInventory inventory, int itemid)
  • Called when the PlayerInventory.FindItemByItemID(int itemid) method is called. For example, when switching ammo types with the currently held weapon, when finding armor to attach to a hot air balloon, when finding a saddle to purchase a horse, and when finding a hood to cover a player's head.
  • Returning an Item value cancels the default behavior, and causes PlayerInventory.FindItemByItemID(int itemid) to return that value
  • Works like the List<Item> OnInventoryItemsFind(PlayerInventory inventory, int itemid) hook but for when Rust is searching for only one item instead of a list of items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant