Installations

Remember that this resource has verified DMCA protection, and its illegal use or distribution could imply a claim for protection of Title 17 of Chapter 512 (c) (3) of the Digital Millennium Copyright Act

STEP 1 - Dependencies

It is important to use the dependencies that are indicated in this step, do not use others, otherwise you will receive critical errors
Quasar Inventory only has two dependencies, which are dpclothing and progressbar, download them by clicking on the following buttons

STEP 2 - Start order

Remember that you must place scripts with usable items below qs-inventory in server.cfg, otherwise they will never work!
It is important to put the resources in the correct order, below qb-core but above the other scripts
In order for the resource to start correctly and not receive any errors, we must start the resources in the following order
1
ensure qs-inventory
2
ensure qs-shops

STEP 3 - Database

Do not start the resource without first having installed the complete database, if you start the resource in the database, you will get critical errors
Inventory database
1
CREATE TABLE IF NOT EXISTS `qs_glovebox` (
2
`id` int(11) NOT NULL AUTO_INCREMENT,
3
`plate` varchar(255) DEFAULT NULL,
4
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
5
PRIMARY KEY (`id`),
6
KEY `plate` (`plate`)
7
) ENGINE = InnoDB AUTO_INCREMENT = 9 DEFAULT CHARSET = latin1;
8
9
CREATE TABLE IF NOT EXISTS `qs_ammo` (
10
`id` int(11) NOT NULL AUTO_INCREMENT,
11
`identifier` varchar(255) NOT NULL,
12
`ammo` text DEFAULT NULL,
13
PRIMARY KEY (`id`),
14
KEY `citizenid` (`identifier`) USING BTREE
15
) ENGINE = InnoDB AUTO_INCREMENT = 3638 DEFAULT CHARSET = latin1;
16
17
CREATE TABLE IF NOT EXISTS `qs_stash` (
18
`id` int(11) NOT NULL AUTO_INCREMENT,
19
`stash` varchar(255) NOT NULL,
20
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
21
PRIMARY KEY (`id`),
22
KEY `stash` (`stash`)
23
) ENGINE = InnoDB AUTO_INCREMENT = 40 DEFAULT CHARSET = latin1;
24
25
CREATE TABLE IF NOT EXISTS `qs_trunk` (
26
`id` int(11) NOT NULL AUTO_INCREMENT,
27
`plate` varchar(255) NOT NULL,
28
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
29
PRIMARY KEY (`id`),
30
KEY `plate` (`plate`)
31
) ENGINE = InnoDB AUTO_INCREMENT = 1141 DEFAULT CHARSET = latin1;
32
33
CREATE TABLE IF NOT EXISTS `qs_customshops` (
34
`cid` varchar(50) DEFAULT NULL,
35
`shopname` varchar(50) DEFAULT NULL,
36
`shopdata` longtext DEFAULT NULL
37
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
38
39
/*!40000 ALTER TABLE `qs_trunk` DISABLE KEYS */;
40
/*!40000 ALTER TABLE `qs_trunk` ENABLE KEYS */;

STEP 4 - Modifications

The longest and most tedious step within the resource is the modification of qb-core, so we also give you the opportunity to use the following pre-modified versions, but if you receive any errors, you should install the modifications yourself by following the steps below

Client modifications

Modifications of qb-core on the client side
LAST QB-CORE

Replace event

We will replace this event completely
../client/functions.lua
1
function QBCore.Functions.HasItem(items, amount)
2
return exports['qs-inventory']:HasItem(items, amount)
3
end

Server modifications

Modifications of qb-core on the server side
LAST QB-CORE

Replace event

We will replace this event completely
../server/functions.lua
1
function QBCore.Functions.UseItem(source, item)
2
if GetResourceState('qs-inventory') == 'missing' then return end
3
exports['qs-inventory']:UseItem(source, item)
4
end
LAST QB-CORE

Replace event

We will replace this event completely
../server/functions.lua
1
function QBCore.Functions.HasItem(source, items, amount)
2
if GetResourceState('qs-inventory') == 'missing' then return end
3
return exports['qs-inventory']:HasItem(source, items, amount)
4
end
LAST QB-CORE

Replace event

We will replace QBCore.Player.CheckPlayerData(source, PlayerData)
../server/player.lua
1
PlayerData.items = GetResourceState('qs-inventory') ~= 'missing' and exports['qs-inventory']:LoadInventory(PlayerData.source, PlayerData.citizenid) or {}
LAST QB-CORE

Replace event

We will replace this event completely
../server/player.lua
1
function self.Functions.GetCardSlot(cardNumber, cardType)
2
local item = tostring(cardType):lower()
3
local slots = exports['qs-inventory']:GetSlotsByItem(self.PlayerData.items, item)
4
for _, slot in pairs(slots) do
5
if slot then
6
if self.PlayerData.items[slot].info.cardNumber == cardNumber then
7
return slot
8
end
9
end
10
end
11
return nil
12
end
LAST QB-CORE

Replace event

We will replace this event completely
../server/player.lua
1
function QBCore.Player.Save(source)
2
local ped = GetPlayerPed(source)
3
local pcoords = GetEntityCoords(ped)
4
local PlayerData = QBCore.Players[source].PlayerData
5
if PlayerData then
6
MySQL.insert('INSERT INTO players (citizenid, cid, license, name, money, charinfo, job, gang, position, metadata) VALUES (:citizenid, :cid, :license, :name, :money, :charinfo, :job, :gang, :position, :metadata) ON DUPLICATE KEY UPDATE cid = :cid, name = :name, money = :money, charinfo = :charinfo, job = :job, gang = :gang, position = :position, metadata = :metadata', {
7
citizenid = PlayerData.citizenid,
8
cid = tonumber(PlayerData.cid),
9
license = PlayerData.license,
10
name = PlayerData.name,
11
money = json.encode(PlayerData.money),
12
charinfo = json.encode(PlayerData.charinfo),
13
job = json.encode(PlayerData.job),
14
gang = json.encode(PlayerData.gang),
15
position = json.encode(pcoords),
16
metadata = json.encode(PlayerData.metadata)
17
})
18
if GetResourceState('qs-inventory') ~= 'missing' then exports['qs-inventory']:SaveInventory(source) end
19
QBCore.ShowSuccess(GetCurrentResourceName(), PlayerData.name .. ' PLAYER SAVED!')
20
else
21
QBCore.ShowError(GetCurrentResourceName(), 'ERROR QBCORE.PLAYER.SAVE - PLAYERDATA IS EMPTY!')
22
end
23
end
LAST QB-CORE

Replace event

We will replace this event completely
../server/player.lua
1
function QBCore.Player.SaveOffline(PlayerData)
2
if PlayerData then
3
MySQL.Async.insert('INSERT INTO players (citizenid, cid, license, name, money, charinfo, job, gang, position, metadata) VALUES (:citizenid, :cid, :license, :name, :money, :charinfo, :job, :gang, :position, :metadata) ON DUPLICATE KEY UPDATE cid = :cid, name = :name, money = :money, charinfo = :charinfo, job = :job, gang = :gang, position = :position, metadata = :metadata', {
4
citizenid = PlayerData.citizenid,
5
cid = tonumber(PlayerData.cid),
6
license = PlayerData.license,
7
name = PlayerData.name,
8
money = json.encode(PlayerData.money),
9
charinfo = json.encode(PlayerData.charinfo),
10
job = json.encode(PlayerData.job),
11
gang = json.encode(PlayerData.gang),
12
position = json.encode(PlayerData.position),
13
metadata = json.encode(PlayerData.metadata)
14
})
15
if GetResourceState('qs-inventory') ~= 'missing' then exports['qs-inventory']:SaveInventory(PlayerData, true) end
16
QBCore.ShowSuccess(GetCurrentResourceName(), PlayerData.name .. ' OFFLINE PLAYER SAVED!')
17
else
18
QBCore.ShowError(GetCurrentResourceName(), 'ERROR QBCORE.PLAYER.SAVEOFFLINE - PLAYERDATA IS EMPTY!')
19
end
20
end
LAST QB-CORE

Replace event

We will replace this event completely
../server/player.lua
1
function QBCore.Player.SaveInventory(source)
2
if GetResourceState('qs-inventory') == 'missing' then return end
3
exports['qs-inventory']:SaveInventory(source, false)
4
end
LAST QB-CORE

Replace event

We will replace this event completely
../server/player.lua
1
function QBCore.Player.SaveOfflineInventory(PlayerData)
2
if GetResourceState('qs-inventory') == 'missing' then return end
3
exports['qs-inventory']:SaveInventory(PlayerData, true)
4
end
LAST QB-CORE

Replace event

We will replace this event completely
../server/player.lua
1
function QBCore.Player.GetTotalWeight(items)
2
if GetResourceState('qs-inventory') == 'missing' then return end
3
return exports['qs-inventory']:GetTotalWeight(items)
4
end
LAST QB-CORE

Replace event

We will replace this event completely
../server/player.lua
1
function QBCore.Player.GetSlotsByItem(items, itemName)
2
if GetResourceState('qs-inventory') == 'missing' then return end
3
return exports['qs-inventory']:GetSlotsByItem(items, itemName)
4
end
LAST QB-CORE

Replace event

We will replace this event completely
../server/player.lua
1
function QBCore.Player.GetFirstSlotByItem(items, itemName)
2
if GetResourceState('qs-inventory') == 'missing' then return end
3
return exports['qs-inventory']:GetFirstSlotByItem(items, itemName)
4
end

STEP 5 - Config framework

We will change the framework in qs-inventory/config/config_framework.lua, there we will change the Config.Framework and place 'QBCore'
../config/config_framework.lua
1
--███████╗██████╗░░█████╗░███╗░░░███╗███████╗░██╗░░░░░░░██╗░█████╗░██████╗░██╗░░██╗
2
--██╔════╝██╔══██╗██╔══██╗████╗░████║██╔════╝░██║░░██╗░░██║██╔══██╗██╔══██╗██║░██╔╝
3
--█████╗░░██████╔╝███████║██╔████╔██║█████╗░░░╚██╗████╗██╔╝██║░░██║██████╔╝█████═╝░
4
--██╔══╝░░██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝░░░░████╔═████║░██║░░██║██╔══██╗██╔═██╗░
5
--██║░░░░░██║░░██║██║░░██║██║░╚═╝░██║███████╗░░╚██╔╝░╚██╔╝░╚█████╔╝██║░░██║██║░╚██╗
6
--╚═╝░░░░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░░░░╚═╝╚══════╝░░░╚═╝░░░╚═╝░░░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝
7
8
Config.Framework = 'QBCore' --- @param Set 'ESX' if you use es_extended or 'QBCore' if you use qb-core.
9
Config.CustomFrameworkExport = false --- @param Do you want to add your own export?
10
11
--- @param If your are using ESX 1.8.5 or higher put in true 'Config.CustomFrameworkExport' and uncomment the ESX function from line 14
12
function CustomFrameworkExport() -- Add the export here, as in the following example.
13
-- ESX = exports["es_extended"]:getSharedObject()
14
-- QBCore = exports['qb-core']:GetCoreObject()
15
end
16
17
--█▀▀ █▀▀ █─█
18
--█▀▀ ▀▀█ ▄▀▄
19
--▀▀▀ ▀▀▀ ▀─▀
20
21
Config.getSharedObject = "esx:getSharedObject" --- @param Modify it if you use an ESX Custom.
22
Config.setJob = "esx:setJob" --- @param Modify it if you use an ESX Custom.
23
Config.playerLoaded = "esx:playerLoaded" --- @param Modify it if you use an ESX Custom.
24
25
26
--▒█▀▀█ ▒█▀▀█ ▒█▀▀█ █▀▀█ █▀▀█ █▀▀
27
--▒█░▒█ ▒█▀▀▄ ▒█░░░ █░░█ █▄▄▀ █▀▀
28
--░▀▀█▄ ▒█▄▄█ ▒█▄▄█ ▀▀▀▀ ▀░▀▀ ▀▀▀
29
30
Config.QBCoreGetCoreObject = 'qb-core' --- @param Modify it if you use an QBCore Custom.
31
Config.QBTraphouseName = 'qb-traphouse' --- @param Traphouse script name for QBCore, only compatible with the latest version of qb-traphouse.
32
Config.QBCoreLastFunctions = true --- @param Select this if you are using the latest version of QBCore only.