Page cover

💾Installation

Installation and download processes are straightforward and fixed. After following the specified steps, you can easily complete the installation.

Before Starting

Installation and download processes are straightforward and fixed. After following the specified steps, you can easily complete the installation. Skipping a small step can lead to significant errors in the future!

Installation

Extract ls-inventory from the downloaded folder and install it on your server.

After installing it on your server, import the SQL database named "ls_inventory.sql" into your server's database.

Requirements

First, make sure that the specified resources have been downloaded and installed on your server;

Framework

QB-CORE

If you're using old qb-core version "before inventory update", find qb-core/server/player.lua after that locate these functions.

Functions Required Change

Locate "self.Functions.AddItem" and replace whole function with,

function self.Functions.AddItem(item, amount, slot, info)
    return exports["ls-inventory"]:AddItem(self.PlayerData.source, item, amount, slot, info)
end

Locate "self.Functions.RemoveItem" and replace whole function with,

function self.Functions.RemoveItem(item, amount, slot)
    return exports["ls-inventory"]:RemoveItem(self.PlayerData.source, item, amount, slot)
end

Locate "self.Functions.GetItemBySlot" and replace whole function with,

function self.Functions.GetItemBySlot(slot)
    return exports["ls-inventory"]:GetItemBySlot(self.PlayerData.source, slot)
end

Locate "self.Functions.GetItemByName" and replace whole function with,

function self.Functions.GetItemByName(item)
    return exports["ls-inventory"]:GetItemByName(self.PlayerData.source, item)
end

Locate "self.Functions.GetItemsByName" and replace whole function with,

function self.Functions.GetItemsByName(item)
    return exports["ls-inventory"]:GetItemsByName(self.PlayerData.source, item)
end

Locate "self.Functions.ClearInventory" and replace whole function with,

function self.Functions.ClearInventory()
    exports["ls-inventory"]:ClearInventory(self.PlayerData.source)
end

Locate "self.Functions.SetInventory" and replace whole function with,

function self.Functions.SetInventory(items)
    -exports["ls-inventory"]:SetInventory(self.PlayerData.source, items)
end
After doing changes, its needs to look like.

ESX

ESX, installation is really basic, first find es_extended/server/classes/player.lua after that locate these functions.

Functions Required Change

Locate "self.addInventoryItem" and replace whole function with,

function self.addInventoryItem(name, count, metadata, slot)
    return exports["ls-inventory"]:AddItem(self.source, name, count, slot, metadata)
end

Locate "self.removeInventoryItem" and replace whole function with,

function self.removeInventoryItem(name, count, metadata, slot)
    return exports["ls-inventory"]:RemoveItem(self.source, name, count, slot)
end

Locate "self.getInventoryItem" and replace whole function with,

function self.getInventoryItem(name, metadata)
    return exports["ls-inventory"]:GetItemByName(self.source, name)
end

Locate "self.hasItem" and replace whole function with,

function self.hasItem(item)
    return exports["ls-inventory"]:HasItem(self.source, item, 1)
end
After doing changes, its needs to look like.
After doing changes, its needs to look like.

Last updated