First Time Setup
IF YOU ARE USING OX_INVENTORY THEN SKIP THIS!!
ox_inventory users will automatically get this functionality without additional changes due to the hooks
that ox_inventory provides. If you use ox and also follow these steps, then your addiction value changes will get doubled, since each item use will trigger two addiction updates
Update to your core script
For anyone not using ox_inventory you'll need to update the UseItem
function in your core script to add an extra export. This is so envi-addictions
knows when an item has been used and will be able to run the addiction checks upon use. If you do not do this, your addictions will not work!
Navigate to
qb-core/server/functions.lua
Find the
QBCore.Functions.UseItem
functionThis should be around line 504, but could differ depending on your version
Add the following export to the bottom of the function:
For example, if you're using qb-inventory then your updated function should look like this:
Last updated