feat (Shared): Added the ability to dynamically update the shared jobs, items and gangs.

This commit is contained in:
Idris
2022-02-13 20:45:49 +11:00
parent 6935e3481e
commit ae29c94a40
4 changed files with 85 additions and 0 deletions
+13
View File
@@ -140,3 +140,16 @@ RegisterNetEvent('QBCore:Command:ShowMe3D', function(senderId, msg)
end
end)
end)
-- Listen to Shared being updated
RegisterNetEvent('QBCore:Client:OnSharedUpdate', function(tableName, key, value)
QBCore.Shared[tableName][key] = value
TriggerEvent('QBCore:Client:UpdateObject')
end)
RegisterNetEvent('QBCore:Client:OnSharedUpdateMultiple', function(tableName, values)
for key, value in ipairs(values) do
QBCore.Shared[tableName][key] = value
end
TriggerEvent('QBCore:Client:UpdateObject')
end)