["pasta"] = { -- Our custom item
["item"] = {
_id = "pasta", -- Item code example, /giveitem 1 pasta
_name = "Pasta", -- Item name
_parent = "", -- Item parent make empty, it will adjust itself
_type = "Item", -- Item type if not an custom object make Item
_data = { -- Data
Name = "Pasta", -- Item name, its listed in JavaScript
Label = "Pasta La Wista", -- Item label
Description = "Its so delicous!", -- Item description, you can see from tooltip
Width = 1, -- Item width (1-x)
Height = 1, -- Item height (x-1)
Weight = 0.5, -- Item weight
ExamineTime = 1.0, -- Item research speed
Backgroundcolor = "black", -- Item background color
ItemSound = "gear_generic", -- Item sound
Type = "Item", -- Item type, same as upper
MaxStack = 1, -- Item stack limit
Grids = {}, -- If not container make empty
Itemimage = "icons/pasta.png", -- Item image
}
}
},
After the creating the item, restart the server. If doesn't want to restart everytime locate config.lua and find Config.Debug = false, make it true. You can restart inventory everytime.
Config.Debug, can causes bunch errors! Do not true in running server.
Item Convert! (QB-ESX)
If you have customized values, locate resources/server/items-convert.lua, and customize to your server.
Start your server, enter the "convertitems" to your server console. It will create config_converted.lua named file, you can transfer all items to config_items.lua
Inventory Keybindings
Dragging items ( Hold left click to item )
Research items ( Middle mouse button to unsearched item )
Research containers ( Middle mouse button to UNSEARCHED text or left click to Search )
Hotbar/Fastuse ( Click 3-9 keys in keyboard 1-2 for first and second weapon never be manually changed! )
Context Menu/Attachment Menu ( Right click to item )
Item Split ( Start dragging a item and hold shift, finally drop the grid, Split thing will be appear on screen. )
Inventory can be opened using F2, if you join the server for one time, F2 saved FiveM keybindings inside of GTA 5! If you change the F2, before joined users keep used F2 key!
Custom Images Per Item
Locate html > classes.js inside inventory folder, Find "GetItemImage" and customize with your own.
After doing that, custom clothing can be useable. If you want to implement the esx_skin or qb-clothing,
We already created a bag if not make one,
For an example, We're gonna edit the backpack 85
if givinItem == "backpack" then -- Slot name located in config.lua
if (itemData == 40 or itemData == 41 or itemData == 44 or itemData == 45 or itemData == 81 or itemData == 82 or itemData == 86) then
givinItem = "bag1"
elseif (itemData == 85) -- Clothing id, coming from GTA V (Same with esx_skin clothing number)
givinItem = "myawesomebag"
end
For QBCore
if givinItem == "backpack" then -- Slot name located in config.lua
if (itemData.item == 40 or itemData.item == 41 or itemData.item == 44 or itemData.item == 45 or itemData.item == 81 or itemData.item == 82 or itemData.item == 86) then
givinItem = "bag1"
elseif (itemData == 85) -- Clothing id, coming from GTA V (Same with qb-clothing clothing number)
givinItem = "myawesomebag"
end
All Clothing Slots
top, Defined for player torso.
shirts, Defined for player t-shirt.
pants, Defined for player pants.
backpack, Defined for player bag/backpack
shoes, Defined for player shoes
mask Defined for player mask
rig Defined for player armor/bulletproof
gloves Defined for player gloves/arms
hat Defined for player hat/helmet
ear Defined for player ears
watch Defined for player watches
glasses Defined for player glasses
bracelet Defined for player bracelets
RegisterNetEvent('inventory:server:OpenInventory', function(name, id, other)
if name == "shop" then
local newShop = {}
for _,v in pairs(other.items) do
newShop[v.name] = v
end
if Config.Items[name] == nil then name = "shop1" end
TriggerClientEvent("inventory:client:OpenShop", source, name, id, newShop)
else
if Config.Items[name] == nil then name = "custom_inventory" end
TriggerClientEvent("inventory:client:OpenInventory", source, name, id, false)
end
end)
local function openShop(shop, data)
local products = data.products
local ShopItems = {}
ShopItems.items = {}
QBCore.Functions.TriggerCallback("qb-shops:server:getLicenseStatus", function(hasLicense, hasLicenseItem)
ShopItems.label = data["label"]
if data.type == "weapon" then
if hasLicense and hasLicenseItem then
ShopItems.items = SetupItems(shop)
QBCore.Functions.Notify(Lang:t("success.dealer_verify"), "success")
Wait(500)
else
for i = 1, #products do
if not products[i].requiredJob then
if not products[i].requiresLicense then
ShopItems.items[#ShopItems.items + 1] = products[i]
end
else
for i2 = 1, #products[i].requiredJob do
if QBCore.Functions.GetPlayerData().job.name == products[i].requiredJob[i2] and not products[i].requiresLicense then
ShopItems.items[#ShopItems.items + 1] = products[i]
end
end
end
end
QBCore.Functions.Notify(Lang:t("error.dealer_decline"), "error")
Wait(500)
QBCore.Functions.Notify(Lang:t("error.talk_cop"), "error")
Wait(1000)
end
else
ShopItems.items = SetupItems(shop)
end
for k in pairs(ShopItems.items) do
ShopItems.items[k].slot = k
end
ShopItems.slots = 30
local newShop = {}
for k,v in pairs(ShopItems.items) do
newShop[v.name] = v
end
exports["ls-inventoryhud"]:ShopInventory("SHOP-"..shop, "shop1", true, newShop)
end)
end