fix(qb-core): add global CreateUsableItem alias for qs-inventory compatibility

qs-inventory apelează CreateUsableItem ca funcție globală, dar qb-core definea doar QBCore.Functions.CreateUseableItem (cu 'e'). Adăugat alias global + fix 16 stringuri sparte în items.lua care blocau parsarea.
This commit is contained in:
2026-04-02 00:08:19 +03:00
parent 096ccb6399
commit 978c9bc759
827 changed files with 3570 additions and 1015 deletions

View File

@@ -0,0 +1,151 @@
Config = Config or {}
-- Clarification if you are going to create more backpacks you have to add the information in these parts:
-- qs-inventory/config/metadata.js
-- Save information
--[[
} else if (itemData.name == "YOUR_BACKPACK_NAME") {
$(".item-info-title").html("<p>" + label + "</p>");
$(".item-info-description").html(
"<p><strong>ID: </strong><span>" +
itemData.info.ID +
"</span></p><p><strong>Weight: </strong><span>" +
itemData.info.weight +
"</span></p><p><strong>Slots: </strong><span>" +
itemData.info.slots +
"</span></p>"
);
]]
-- qs-inventory/server/custom/GiveItemToPlayer.lua
-- For giveitem admin
--[[
elseif itemData["name"] == "YOUR_BACKPACK_NAME" then
info.ID = 'backpack_'..math.random(111111,999999)
info.weight = 10000
info.slots = 10
]]
-- (IMPORTANT INTEGRATION WITH qs-advancedshops or qs-shops)
-- If you want to add the backpack to a qs-shop, you must add an ID to the item. this is the example :
--[[
qs-shops/config/config.lua or qs-advancedshops/config/shops.lua
[1] = {
name = "backpack",
label = 'Backpack',
price = 250,
amount = 100,
info = {}, -- If you put here info = {}, it will automatically take the weight of your configuration
type = "item",
slot = 1,
},
[2] = {
name = "my_custom_backpack",
label = 'UwU Backpack',
price = 250,
amount = 100,
info = { ID = 'ID_'..math.random(111111,999999), weight = 10000 , slots = 10}, -- If you put this information, it will take the information you put in it
type = "item",
slot = 2,
},
]]
-- (important) do not use both prop and cloth at same time just one.
Config.Items = {
['backpack'] = { --- Item name
slots = 10, -- Change in `qs-inventory/server/custom/GiveItemToPlayer.lua`
weight = 100000, -- Change in `qs-inventory/server/custom/GiveItemToPlayer.lua`
locked = false, -- If you want to have a password change false to true
prop = {
model = 'vw_prop_vw_backpack_01a',
animation = {
dict = 'amb@world_human_hiker_standing@female@base',
anim = 'base',
bone = 'Back', -- LeftHand | RightHand
attaching_position = {
x = -0.20, -- Up - Down
y = -0.10, -- Forward Backward
z = 0.0, -- Left - Right
x_rotation = 10.0,
y_rotation = 90.0,
z_rotation = 175.0,
}
},
},
},
['backpack2'] = {
slots = 6, -- Change in `qs-inventory/server/custom/GiveItemToPlayer.lua`
weight = 10000, -- Change in `qs-inventory/server/custom/GiveItemToPlayer.lua`
cloth = {
male = {
['bag'] = { item = 45, texture = 0 }
},
female = {
['bag'] = { item = 45, texture = 0 }
}
}
},
['briefcase'] = {
slots = 3,
weight = 5000,
locked = true, -- If you want to have a password change false to true
prop = {
model = 'prop_ld_suitcase_01',
animation = {
dict = 'missheistdocksprep1hold_cellphone',
anim = 'static',
bone = 'RightHand',
attaching_position = {
x = 0.10,
y = 0.0,
z = 0.0,
x_rotation = 0.0,
y_rotation = 280.0,
z_rotation = 53.0,
}
},
},
},
['paramedicbag'] = {
slots = 10, -- Change in `qs-inventory/server/custom/GiveItemToPlayer.lua`
weight = 10000, -- Change in `qs-inventory/server/custom/GiveItemToPlayer.lua`
prop = {
model = 'xm_prop_smug_crate_s_medical',
animation = {
dict = 'missheistdocksprep1hold_cellphone',
anim = 'static',
bone = 'RightHand',
attaching_position = {
x = 0.29,
y = -0.05,
z = 0.0,
x_rotation = -25.0,
y_rotation = 280.0,
z_rotation = 75.0,
}
},
}
},
}
Config.Bones = {
bones = {
['RightHand'] = {
bone = 57005,
current_active_porp = nil,
slot = -1,
},
['Back'] = {
bone = 24818,
current_active_porp = nil,
slot = -1,
},
['LeftHand'] = {
bone = 18905,
current_active_porp = nil,
slot = -1,
},
}
}

View File

@@ -0,0 +1,92 @@
Config = Config or {}
Locales = Locales or {}
local esxHas = GetResourceState('es_extended') == 'started'
local qbHas = GetResourceState('qb-core') == 'started'
local qbxHas = GetResourceState('qbx_core') == 'started'
Config.Framework = esxHas and 'esx' or qbHas and 'qb' or qbxHas and 'qb' or 'esx'
--[[
Language settings.
Define the language file located in the locales folder.
]]
Config.Language = 'en' -- Set your lang in locales folder
--[[
Skin script configuration.
Supported options:
- 'qb-clothing': For servers using QBCore's clothing script.
- 'illenium-appearance': For servers using Illenium Appearance.
- 'esx_skin': For servers using the ESX Skin system.
]]
Config.SkinScript = 'illenium-appearance' -- 'qb-clothing', 'illenium-appearance', 'esx_skin'
--[[
Menu system configuration.
Supported options:
- 'qb-menu': For QBCore's menu system.
- 'ox_lib': For Ox Library's menu system.
- 'esx_menu_default': For ESX's default menu system.
]]
Config.Menu = 'qb-menu' -- 'qb-menu', 'ox_lib', 'esx_menu_default'
--[[
Hotbar slots configuration.
Specify the slots that will act as your hotbar.
Use an array of numbers, where each number represents a slot.
]]
Config.Hotbar = {
1, 2, 3, 4, 5
}
--[[
Backpack opening/closing duration.
Configure the time (in seconds) it takes to open or close the backpack.
]]
Config.duration = {
open = 1, -- Time in seconds to open the backpack.
close = 1 -- Time in seconds to close the backpack.
}
--[[
Password length settings.
Define the minimum and maximum length for passwords when required.
]]
Config.PasswordLength = {
min = 3, -- Minimum password length.
max = 5 -- Maximum password length.
}
--[[
Animation configuration for different backpack actions.
Each action includes:
- Dict: The animation dictionary used for the action.
- Anim: The specific animation name.
- Flag: The animation flag (e.g., 49 = upper body only).
]]
Config.Animation = {
close = { -- Animation for closing the backpack.
Dict = 'clothingshirt', -- Animation dictionary.
Anim = 'try_shirt_positive_d', -- Animation name.
Flag = 49 -- Animation flag.
},
open = { -- Animation for opening the backpack.
Dict = 'clothingshirt', -- Animation dictionary.
Anim = 'try_shirt_positive_d', -- Animation name.
Flag = 49 -- Animation flag.
},
inBackpack = { -- Animation for interacting with items in the backpack.
Dict = 'clothingshirt', -- Animation dictionary.
Anim = 'try_shirt_positive_d' -- Animation name.
},
}