mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 23:01:29 +00:00
GetShared fix
This commit is contained in:
+6
-4
@@ -17,12 +17,14 @@ local function GetCoreObject(filters)
|
|||||||
end
|
end
|
||||||
exports('GetCoreObject', GetCoreObject)
|
exports('GetCoreObject', GetCoreObject)
|
||||||
|
|
||||||
--- @param namespace 'Vehicles' | 'VehicleHashes' | 'Items' | 'Gangs' | 'Jobs' | 'Locations' | 'Weapons'
|
--- @param namespace 'Vehicles' | 'VehicleHashes' | 'Items' | 'Gangs' | 'Jobs' | 'Locations' | 'Weapons' | 'StarterItems'
|
||||||
--- @param item string
|
--- @param item string?
|
||||||
--- @return table
|
--- @return table?
|
||||||
function GetShared(namespace, item)
|
function GetShared(namespace, item)
|
||||||
local ns = QBCore.Shared[namespace]
|
local ns = QBCore.Shared[namespace]
|
||||||
return ns and ns[item]
|
if not ns then return nil end
|
||||||
|
|
||||||
|
return item and ns[item] or ns
|
||||||
end
|
end
|
||||||
|
|
||||||
exports('GetShared', GetShared)
|
exports('GetShared', GetShared)
|
||||||
|
|||||||
Reference in New Issue
Block a user