script_author('chapo')
local directIni = 'RelogPosition.ini'
local ini = inicfg.load(inicfg.load({
pos = {
x = 0,
y = 0,
z = 10,
},
}, directIni))
inicfg.save(ini, directIni)
local saved = {x = ini.pos.x, y = ini.pos.y, z = ini.pos.z}
function main()
while not isSampAvailable() do wait(0) end
while not sampIsLocalPlayerSpawned() do wait(0) end
x, y, z = getCharCoordinates(PLAYER_PED)
if x ~= saved.x or y ~= saved.y or z ~= saved.z then
setCharCoordinates(PLAYER_PED, saved.x, saved.y, saved.z)
end
wait(-1)
end
function onScriptTerminate(s, q)
if s == thisScript() then
x, y, z = getCharCoordinates(PLAYER_PED)
ini.pos.x, ini.pos.y, ini.pos.z = x, y, z
inicfg.save(ini, directIni)
end
end