diff --git a/resources/[essential]/es_extended/client/main.lua b/resources/[essential]/es_extended/client/main.lua index 309e8cda..66ed6b61 100644 --- a/resources/[essential]/es_extended/client/main.lua +++ b/resources/[essential]/es_extended/client/main.lua @@ -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) \ No newline at end of file