From 4f63c141b9adef6fe6a487a84a0a40bed3650b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 30 Aug 2017 19:40:49 +0200 Subject: [PATCH] Fix position with new system --- .../[essential]/es_extended/client/main.lua | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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