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
function saveap(id)
	if player(id, "exists") and (player(id, "usgn")>-1) then
		file = io.open("zi_saves/"..player(id, "usgn")..".txt", "w")
		file:write(pl_ammopack[id])
		file:close()
	end
end
function loadap(id)
	if player(id, "exists") then
		local usgn = player(id, "usgn")
		if (usgn > -1) then
			local file = io.open("zi_saves/"..usgn..".txt", "r")
			if (file~=nil) then
				pl_ammopack[id]=file:read("*a")
				if (pl_ammopack[id]==nil) or (pl_ammopack[id]=="") then saveap(id) end
				file:close()
			else
				pl_ammopack[id]=0
				saveap(id)
			end
		end
	end
end
file = io.open("zi_saves/"..player(1, "usgn")..".txt", "r")
if (file==nil) then
os.execute("mkdir zi_saves")
pl_ammopack[1]=0
saveap(1)
end