local playerName = getPlayerAccount( thePlayer )
function saved( thePlayer )
if (playerName) then
local x, y, z = getElementPosition( thePlayer )
if (x, y, z) then
setAccountData( playerName, "positions", x, y, z)
end
end
end
function setback( thePlayer, playerName )
if (playerName) then
local xX, yY, zZ = getAccountData( thePlayer, "positions" )
if (xX, yY, zZ) then
setElementPosition( thePlayer, xX, yY, zZ)
end
end
end
addEventHandler("onPlayerQuit", getRootElement(), saved)
addEventHandler("onPlayerLogin", getRootElement(), setback)