Installation


1. Download Resource

Download the purchased resource from CFX Portal - Official Website of FiveM/RedM with your purchased assets.


2. Download Dependencies

Download all the dependencies needed for Dex Addictions.


3. Change function of NUIService.lua in vorp_inventory

For the script to be able to detect the usage of any item from anywhere, you need to use this function. Simply replace the function inside NUIService.lua for this one:

File should be at vorp_inventory\client\services\NUIService.lua

local function useItem(data)
	if timerUse <= 0 then
		TriggerServerEvent("vorp_inventory:useItem", data)

		TriggerEvent("vorp_inventory:useDetection", data.name or data.item)

		timerUse = 2000
	else
		Core.NotifyRightTip(T.slow, 5000)
	end
end

4. Insert table in DB

For the addictions to be persistent and for the script to fully work, you need to insert the following:

CREATE TABLE IF NOT EXISTS addictions (
  identifier VARCHAR(50) PRIMARY KEY,
  addictions LONGTEXT,
  last_use LONGTEXT
);

5. Start Resource

To start the resource in the server.cfg, make the sure it's been iniciated before the VORP Framework. When using a framework like vorp_core, you should start the resource after like so:

ensure oxmysl #Example, oxmysql has to start first
ensure vorp_core # Example, here is your framework
ensure vorp_inventory # Example, dependencies

# Dex Resources
ensure Dex_Addictions

Make sure there are no syntax errors in your server.cfg .

Last updated