itemRemoved
The qb-inventory:server:itemRemoved
and qb-inventory:client:itemRemoved
events are triggered whenever an item is removed from a player's inventory. You can use these events to implement custom logic when specific items are removed.
The event has the prefix "qb-" for automatic integration to qbcore.
Event Structure (Server-Side)
Event Structure (Client-Side)
Parameters
source: The player's source ID (integer).
item: The item name being removed (string).
amount: The quantity of the item being removed (integer).
totalAmount: The total quantity of the item remaining in the inventory after the removal (integer).
Basic Example: Detect Specific Item Removal
Server-Side
Client-Side
Implementation Steps
Place the server-side code in a server-side Lua file and the client-side code in a client-side.
Match the
item
parameter with the item names defined in your inventory system.Add any custom functionality, such as notifications, logging, or effects, as needed.
These events provide an effective way to track and respond to item removals in your inventory system.
Last updated