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
addhookfunction totable(t,match)
local cmd = {}
if not match then match = "[^%s]+" end
for word in string.gmatch(t, match) do
table.insert(cmd, word)
end
return cmd
end
function load(id)
usgn = player(id,"usgn")
if (usgn > 0) then
local usgn = player(id,"usgn")
files = io.open("sys/lua/scelldata/"..usgn..".txt","r")
if(files~=nil) then
msg2(id,"©000255000Your save file found!@C")
msg2(id,"©160160255Your U.S.G.N ID: "..usgn.."@C")
parse('hudtxt2 '..id..' 7 "©000255000Login as: '..usgn..'" 40 415')
for line in io.lines("sys/lua/scelldata/"..usgn..".txt","r") do
local parses = totable(line)
if (tonumber(parses[1])>0) then
yourmon[id] = tonumber(parses[1])
license[id] = tonumber(parses[2])
break
end
end
else
msg2(id,"©255000000Failed to load save!@C")
msg2(id,"©255000000Please check your U.S.G.N account settings!@C")
end
end
end
addhook("leave","save")
function save(id)
if (player(id,"usgn") > 0) then
save_data = license[id].." "..yourmon[id]
file = assert(io.open("sys/lua/scelldata/"..usgn..".txt","w"))
file:write(save_data)
file:close()
msg2(id,'©000255001Save Data Successfull!@C')
else
msg2(id,"©255000000Failed to Save!@C")
end
it work but i go out1
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
50
51
52
53
54
55
56
57
58
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
license = initArray(32)
posy = initArray(32)
posx = initArray(32)
collect = initArray(32)
addhook("leave","license_leave")
function license_leave(id)
license[id]=0
collect[id]=0
posy[id]=0
posx[id]=0
end
addhook("serveraction","license_action")
function license_action(id,b)
if license[id]==1 and b==2 then
menu(id,"License Menu,Set Pos,Teleport,Togle Spawn(0)")
elseif license[id]==0 and b==2 then
msg2(id,"You have license? buy type !buylicense ^^")
end
end
addhook("menu","license_menu")
function license_menu(id,title,button)
if title=="License Menu" then
if button==1 and player(id,"health")>0 then
posx[id]=player(id,"x")
posy[id]=player(id,"y")
msg2(id,"©000255000Your saved spawnpoint is x:"..posx[id].." y:"..posy[id].." now!@C")
elseif button==2 and posy[id]==0 and posx[id]==0 and player(id,"health")>0 then
msg2(id,"©000255000 You don't have Position")
else
parse ("setpos "..id.." "..posx[id].." "..posy[id]) end
elseif button==3 and collect[id]==0 and player(id,"health")>0 then
msg2(id,"Collection ON")
collect[id]=1
elseif button==3 and collect[id]==1 and player(id,"health")>0 then
msg2(id,"Collection OFF")
collect[id]=0
end
end
addhook("walkover","license_collect")
function license_collect(id)
if collect[id]==1 then
return 1
elseif collect[id]==0 then
return 0
end
end
i don't see Collect in menu