I can not load the data of the game, when saving the game the file is created and saved automatically in the indicated folder but when re-entering the server the data does not load.
Does anyone know the reason?
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
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
function SaveUserStat(id,UsgnID) 	file = io.open("sys/lua/rp_citylife/"..UsgnID..'.txt', "w+") or io.tmpfile() 	local text = "" 	text = tostring(rp_money[id]) 	text = text .." "..rp_license[id] 	if rp_arrest[id]==true then 		text = text .." 1" 	else 		text = text .." 0" 	end 		 	for k, v in ipairs(Addons) do 		text = text .." "..v.FLic[id] 	end 	file:write(text) 	file:close() end function LoadUserStat(id,file) 	for line in file:lines() do 		local parses = totable(line) 		local userMoney=tonumber(parses[1]) 		if userMoney ~= nil then 			rp_money[id]= userMoney 		end 		if (tonumber(parses[2])~=nil) then 			rp_license[id]=tonumber(parses[2]) 		end 		if (tonumber(parses[3]) == 1) then 			rp_arrest[id]=true 			rp_license[id]=0 		end 		 		local counter=3 		for k, v in ipairs(Addons) do 			counter=counter+1 			local LicItem = tonumber(parses[counter]) 			if LicItem~=nil then 				v.FLic[id]=LicItem 			else 				v.FLic[id]=0 			end 		end 	end end
edited 1×, last 13.10.17 09:03:10 am