fix(es_extended/imports): init metatable

This commit is contained in:
Kenshin13
2025-07-06 16:06:36 +02:00
parent 23615a0dd9
commit f692f6fc06
+6
View File
@@ -4,6 +4,10 @@ ESX.currentResourceName = GetCurrentResourceName()
OnPlayerData = function (key, val, last) end
local function TrackPedCoordsOnce()
if not ESX or not ESX.PlayerData then
return
end
ESX.PlayerData.coords = nil
setmetatable(ESX.PlayerData, {
@@ -37,6 +41,8 @@ if not IsDuplicityVersion() then -- Only register this event for the client
TrackPedCoordsOnce()
end)
TrackPedCoordsOnce()
ESX.SecureNetEvent("esx:onPlayerLogout", function()
ESX.PlayerLoaded = false
ESX.PlayerData = {}