for example:
when player leave the server arrays
x[id]
y[id]
save in another file on server's cs2d dir (USGNS)
when he join the server file will be loaded
can someone help mke with this pleeasE?
function save(what, where, how) if how == nil or how == "r" then how = "w" end local f = io.open(where, how) f:write(what) f:close() end function load(what, where) local f = io.open(where, "r") local r = f:read("*"..what) f:close() return r end
save(x[id], "sys/lua/saves/"..player(id, "usgn")..".txt") x[id] = load("n", "sys/lua/saves/"..player(id, "usgn")..".txt")
local text = "" for l in io.lines("sys/lua/einstellung") do text = string.format("%s %s",text,l) end local current = 0 local charpos = 0 for char = 1,string.len(text) do if string.sub(text,char,char)==";" then if charpos~=0 then current = current + 1 dm.options[current] = tonumber(string.sub(text,charpos+1,char-1)) charpos = 0 elseif charpos==0 then charpos = char end end end