mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-03 03:38:50 +00:00
fix(datastore): Fix bug when datastore was too big
Needs newest esx_datastore (1.0.1)
This commit is contained in:
+17
-5
@@ -490,19 +490,31 @@ end)
|
||||
ESX.RegisterServerCallback('esx_property:getPlayerDressing', function(source, cb)
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local dressing = {}
|
||||
|
||||
TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store)
|
||||
|
||||
local storeDressing = store.get('dressing')
|
||||
local count = store.count('dressing')
|
||||
local labels = {}
|
||||
|
||||
if storeDressing ~= nil then
|
||||
dressing = storeDressing
|
||||
for i=1, count, 1 do
|
||||
local entry = store.get('dressing', i)
|
||||
table.insert(labels, entry.label)
|
||||
end
|
||||
|
||||
cb(labels)
|
||||
|
||||
end)
|
||||
|
||||
cb(dressing)
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_property:getPlayerOutfit', function(source, cb, num)
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store)
|
||||
local outfit = store.get('dressing', num)
|
||||
cb(outfit.skin)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user