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,34 @@
--[[
Hi dear customer or developer, here you can fully configure your server's
framework or you could even duplicate this file to create your own framework.
If you do not have much experience, we recommend you download the base version
of the framework that you use in its latest version and it will work perfectly.
]]
if Config.Framework ~= 'esx' then
return
end
ESX = exports['es_extended']:getSharedObject()
function RegisterUsableItem(name, cb)
exports['qs-inventory']:CreateUsableItem(name, cb)
end
function GetPlayerFromId(source)
return ESX.GetPlayerFromId(source)
end
function GetIdentifier(source)
return ESX.GetPlayerFromId(source).identifier
end
function AddItem(source, item, count, slot)
exports['qs-inventory']:AddItem(source, item, count, slot)
end
function RemoveItem(source, item, count)
local xPlayer = GetPlayerFromId(source)
xPlayer.removeInventoryItem(item, count)
end

View File

@@ -0,0 +1,34 @@
--[[
Hi dear customer or developer, here you can fully configure your server's
framework or you could even duplicate this file to create your own framework.
If you do not have much experience, we recommend you download the base version
of the framework that you use in its latest version and it will work perfectly.
]]
if Config.Framework ~= 'qb' then
return
end
QBCore = exports['qb-core']:GetCoreObject()
function RegisterUsableItem(name, cb)
exports['qs-inventory']:CreateUsableItem(name, cb)
end
function GetPlayerFromId(player)
return QBCore.Functions.GetPlayer(player)
end
function GetIdentifier(player)
return QBCore.Functions.GetPlayer(player).PlayerData.citizenid
end
function AddItem(source, item, count, slot)
exports['qs-inventory']:AddItem(source, item, count, slot)
end
function RemoveItem(source, item, count)
local xPlayer = GetPlayerFromId(source)
xPlayer.Functions.RemoveItem(item, count)
end