mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
Lazy and poorly "typed" shops guide. Update AddItem and RemoveItem typings and improve examples. Add hooks.
988 B
988 B
Removes the specified item from the specified inventory.
exports.ox_inventory:RemoveItem(inv, item, count, metadata, slot)
- inv:
tableorstringornumber- The inventory's unique id, or a table with the id and owner.
- playerId:
1, inventoryId:gloveVGH283,{ id = 'personallocker', owner = 'license:xxxxxx'}
- playerId:
- The inventory's unique id, or a table with the id and owner.
- item:
string- The name of the item to remove from the target.
- count:
number- The number of items to remove.
- metadata?:
tableorstring- Only remove items with matching metadata properties.
- slot?:
number- A specific slot to remove the item from. If the slot is invalid, the first available slot will be used instead.
- cb?: function(success:
boolean, response?:string)
Returns success as a boolean, stating whether the item was successfully removed.
Example:
-- Removes 2 water from the glovebox for the given plate.
local success = exports.ox_inventory:RemoveItem('gloveVGH283', 'water', 2)