Fix position with new system

This commit is contained in:
Jérémie N'gadi
2017-08-30 19:40:49 +02:00
parent 9c849044d5
commit 4f63c141b9
@@ -546,5 +546,25 @@ Citizen.CreateThread(function()
end
end
end)
-- Last position
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
if ESX ~= nil and ESX.PlayerLoaded then
local playerPed = GetPlayerPed(-1)
local coords = GetEntityCoords(playerPed)
if not IsEntityDead(playerPed) then
ESX.PlayerData.lastPosition = {x = coords.x, y = coords.y, z = coords.z}
end
end
end
end)