1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function lvlandexpsys(id)
	for id = 1,32 do
		if player(id,"exists") then
			if(levelsystem==1) then
				parse('hudtxt2 '..id..' 1 "©255128000Level: '..lvl[id]..' " 10 150')
				parse('hudtxt2 '..id..' 2 "©128255000Exp : '..xexp[id]..'/'..upexp[id]..' " 10 165')
			else
				parse('hudtxt2 '..id..' 1 " " 10 150')
				parse('hudtxt2 '..id..' 2 " " 10 165')
			end
		end
	end
end
function save_leave(id)
if (player(id,"usgn")>0) then
io.output(io.open("sys/lua/lvlandexpsaves/"..player(id,"usgn")..".txt","w+"))
io.write(xexp[id].." "..lvl[id])
io.close()
end
end
function save_die(id)
if (player(id,"usgn")>0) then
io.output(io.open("sys/lua/lvlandexpsaves/"..player(id,"usgn")..".txt","w+"))
io.write(xexp[id].." "..lvl[id])
io.close()
end
end
function save_join(id)
	if (player(id,"usgn")>0) then
		local filename = "sys/lua/lvlandexpsaves/%s.txt"
		local file = io.open(filename:format(player(id,"usgn"), "r"))
		local line
		if not file then
			line = {0, 1}
			msg2(id,"©255000000Failed to save!@C")
		else
			line = file:read("*a"):split()
		end
		xexp[id] = tonumber(line[1]) or 0
		lvl[id] = tonumber(line[2]) or 1
	else
		msg2(id,"©255000000No USGN found!@C")
		level[id]=1
	end
end
jetz wirds gespeichert.