First Time Setup

IF YOU ARE USING OX, TGIANN, OR QS INVENTORY THEN SKIP THIS!!


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!

  1. Navigate to qb-core/server/functions.lua

  2. Find the QBCore.Functions.UseItem function

    1. This should be around line 504, but could differ depending on your version

  3. Add the following export to the bottom of the function:

    1. exports['envi-addictions']:UsedItem(source, item)
    2. For example, if you're using qb-inventory then your updated function should look like this:

      function QBCore.Functions.UseItem(source, item)
          if GetResourceState('qb-inventory') == 'missing' then return end
          exports['qb-inventory']:UseItem(source, item) -- This might differ depending on what inventory you're using
          exports['envi-addictions']:UsedItem(source, item) -- MAKE SURE YOU ADD THIS LINE
      end

Last updated