Add GetDataStoreOwners

This commit is contained in:
Jérémie N'gadi
2017-09-13 14:49:27 +02:00
parent 2fa1b2b4c3
commit 600e0d5a1f
+16
View File
@@ -78,6 +78,18 @@ function GetDataStore(name, owner)
end
end
function GetDataStoreOwners(name)
local identifiers = {}
for i=1, #DataStores[name], 1 do
table.insert(identifiers, DataStores[name][i].owner)
end
return identifiers
end
function GetSharedDataStore(name)
return SharedDataStores[name]
end
@@ -86,6 +98,10 @@ AddEventHandler('esx_datastore:getDataStore', function(name, owner, cb)
cb(GetDataStore(name, owner))
end)
AddEventHandler('esx_datastore:getDataStoreOwners', function(name, cb)
cb(GetDataStoreOwners(name))
end)
AddEventHandler('esx_datastore:getSharedDataStore', function(name, cb)
cb(GetSharedDataStore(name))
end)