Players Last Location not saving [ESX]

When a player leaves the server their postiton doesnt save and ive researched everything i could until making this. But when a player selects their location they first spawn and {“x”:0.0,“y”:0.0,“z”:0.0,“heading”:0.0} and then teleport to that location dead and if they select last location they spawn at {“x”:0.0,“y”:0.0,“z”:0.0,“heading”:0.0} dead