fix(esx_core): 🔨 send metadata to the client

This commit is contained in:
Arctos2win
2024-10-08 19:52:14 +02:00
committed by GitHub
parent d61abc5096
commit 9bbe1f7f1c
2 changed files with 6 additions and 1 deletions
+4
View File
@@ -708,3 +708,7 @@ end)
ESX.RegisterClientCallback("esx:GetVehicleType", function(cb, model)
cb(ESX.GetVehicleType(model))
end)
RegisterNetEvent('esx:updatePlayerData', function(key, val)
ESX.SetPlayerData(key, val)
end)
+2 -1
View File
@@ -827,6 +827,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
self.metadata[index] = type(self.metadata[index]) == "table" and self.metadata[index] or {}
self.metadata[index][value] = subValue
end
self.triggerEvent('esx:updatePlayerData', 'metadata', self.metadata)
end
function self.clearMeta(index, subValues)
@@ -870,7 +871,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
else
return print(("[^1ERROR^7] xPlayer.clearMeta ^5subValues^7 should be ^5string^7 or ^5table^7, received ^5%s^7!"):format(type(subValues)))
end
self.triggerEvent('esx:updatePlayerData', 'metadata', self.metadata)
end
for fnName, fn in pairs(targetOverrides) do