qb-inventory does
not, so a product that needs it reports this and stops:
qb-inventory’s files. Nothing else on your
server changes.
Only products that watch items moving need this. If no product prints the line above, there is
nothing to do.
Before you start
qb-inventoryfromqbcore-framework/qb-inventory, running on your server. In a fork the function names are the same, but the surrounding lines may differ.- A copy of
server/functions.luaandserver/main.luafromqb-inventory, to restore if needed.
Steps
1
Add the export
At the end of
qb-inventory/server/functions.lua, add:2
Call it before an item moves
In Inside it, after the two lines that call Returning early is what refuses the move: the item never leaves its slot, and the player’s
inventory redraws unchanged.
qb-inventory/server/main.lua, find the handler that starts like this:getItem and before anything is added or removed,
insert:3
Restart both
Check that it worked
The product no longer prints the line above when it starts. Move an item into an inventory the product watches: if the product refuses that move, the item stays where it was.What a handler receives
A handler that returns
false refuses the move. Anything else, including returning nothing, allows
it.
After a qb-inventory update
Updatingqb-inventory overwrites both files. Apply both steps again. If you forget, the product
prints the line above again at start, so it does not fail silently.