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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
function Array(size,value)
	local array = {}
	for i = 1, size do
		array[i]=value
	end
	return array
end
rp_license = Array(32,false)
rp_license2 = Array(32,0)
rp_money = Array(32,0)
addhook("join","loadcash2")
function loadcash2(id)
if rp_license2[id]==1 then
rp_license[id]=true
end
if (player(id,"usgn") > 0) then
local usgn, i = player(id,"usgn")
if (usgn > 0) then
local f = (io.open('sys/lua/license/'..player(id,"usgn")..'.txt','r'))
if f then
		msg2(id,'')
for line in f:lines() do
i = 1
if (i == 1) then
rp_license2[id] = tonumber(line)
else
break
end
end
f:close()
i = 1
else
msg2(id,'')
end
else
msg2(id,'')
end
end
if (player(id,"usgn") > 0) then
local usgn, i = player(id,"usgn")
if (usgn > 0) then
local f = (io.open('sys/lua/saves/'..player(id,"usgn")..'.txt','r'))
if f then
		msg2(id,'©000255001Load Successfull!@C')
for line in f:lines() do
i = 1
if (i == 1) then
rp_money[id] = tonumber(line)
else
break
end
end
f:close()
i = 1
else
msg2(id,'We are sorry, but failed to load save!@C')
end
else
msg2(id,'Please Check Your U.S.G.N. Account Settings!@C')
end
end
end
addhook("leave","save2")
function save2(id)
if rp_license2[id]==1 then
rp_license[id]=true
end
if rp_license[id]==true then
rp_license2[id]=1
end
if (player(id,"usgn") > 0) then
f = assert(io.open('sys/lua/license/'..player(id,"usgn")..'.txt','w'))
f:write(rp_license2[id])
f:close()
msg2(id,'')
else
msg2(id,'')
end
if (player(id,"usgn") > 0) then
f = assert(io.open('sys/lua/saves/'..player(id,"usgn")..'.txt','w'))
f:write(rp_money[id])
f:close()
msg2(id,'©000255001Save Successfull!@C')
else
msg2(id,'©255000000Failed to Save!@C')
end
end