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:
@@ -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
|
||||
@@ -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
|
||||
BIN
resources/[framework]/[addons]/[quasar]/qs-armor/server/main.lua
Normal file
BIN
resources/[framework]/[addons]/[quasar]/qs-armor/server/main.lua
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user