1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pos = {}
addhook('join', 'AA_join')
addhook('leave', 'AA_leave')
addhook('spawn', 'AA_spawn')
function AA_join(id)
if io.open('sys/lua/saves/pos'..player(id, 'usgn')..'.lua') then
dofile('sys/lua/saves/pos'..player(id, 'usgn')..'.lua')
end
end
function AA_leave(id)
local file = io.open('sys/lua/saves/pos'..player(id, 'usgn')..'.lua', 'w')
file:write('pos['..player(id, 'usgn')..'] = {'..player(id, 'x')..','..player(id, 'y')..'}')
end
function AA_spawn(id)
if io.open('sys/lua/saves/pos'..player(id, 'usgn')..'.lua') then
parse('setpos '..id..' '..pos[player(id, 'usgn')][1]..' '..pos[player(id, 'usgn')][2])
		 os.remove('sys/lua/saves/pos'..player(id, 'usgn')..'.lua')
end
end