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,23 @@
|
||||
if Config.Framework ~= 'esx' then
|
||||
return
|
||||
end
|
||||
|
||||
ESX = exports['es_extended']:getSharedObject()
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded')
|
||||
AddEventHandler('esx:playerLoaded', function()
|
||||
Wait(3500)
|
||||
ESX.PlayerLoaded = true
|
||||
end)
|
||||
|
||||
function IsPlayerLoaded()
|
||||
return ESX.PlayerLoaded
|
||||
end
|
||||
|
||||
function GetPlayerData()
|
||||
return ESX.GetPlayerData()
|
||||
end
|
||||
|
||||
function GetInventory()
|
||||
return GetPlayerData().inventory
|
||||
end
|
||||
@@ -0,0 +1,23 @@
|
||||
if Config.Framework ~= 'qb' then
|
||||
return
|
||||
end
|
||||
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerLoaded')
|
||||
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
|
||||
Wait(3500)
|
||||
LocalPlayer.state:set('isLoggedIn', true, false)
|
||||
end)
|
||||
|
||||
function IsPlayerLoaded()
|
||||
return LocalPlayer.state['isLoggedIn']
|
||||
end
|
||||
|
||||
function GetPlayerData()
|
||||
return QBCore.Functions.GetPlayerData()
|
||||
end
|
||||
|
||||
function GetInventory()
|
||||
return GetPlayerData().items
|
||||
end
|
||||
Binary file not shown.
Reference in New Issue
Block a user