English load data not work| roleplay

6 replies
Goto Page
To the start Previous 1 Next To the start
13.10.17 08:32:55 am
Up
Destajador
User
Offline Off
Hi unreal sofware.
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?


Code:
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
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


Load >
edited 1×, last 13.10.17 09:03:10 am
13.10.17 11:45:43 am
Up
Masea
Super User
Offline Off
Surprised that people still using middle-age ways. Use this and save yourself from these shitty issues: file cs2d [SALT] Save and Load Tables (12)
"The best taste of the life is doing things that people say you cannot."
13.10.17 06:39:30 pm
Up
Destajador
User
Offline Off
@user Masea: thanks it was a big help √
> Pd: @user Masea: share with unreal software your csgo mod.
good if it still works, since we are having many problems with graphics here.
13.10.17 06:57:42 pm
Up
Masea
Super User
Offline Off
@user Destajador: Just give up dude, I'll never share that.

Yet, I'm thinking to upload a file which is about setting up your GUI easily. Such as creating buttons, menus and so on. I just need some more ideas then it'll probably be ready soon.
"The best taste of the life is doing things that people say you cannot."
14.10.17 12:31:25 am
Up
Destajador
User
Offline Off
@user Masea: I think your work in that script is totally great.
and players from different parts of the world would be happy to play it. but your server does not have very good ping. Would not you like to see your work being used over the years?
I think there should be more quality codes for cs2d to shine on steam using quality servers.
it is a mistake to reserve the mods for your own use only, and if you think about sharing quality codes, I will recognize you as an excellent scripter, and we will all be grateful for your work.
Collaborate with this game to raise it to a new level. ∗ ∗ ∗
14.10.17 12:46:15 am
Up
Masea
Super User
Offline Off
@user Destajador: I have no server at the moment though. What actually is it you are talking about?

In the other hand, this community still has sides that I don't like such as: http://www.unrealsoftware.de/forum_posts.php?post=22135&start=1480#post414577

"The best taste of the life is doing things that people say you cannot."
14.10.17 01:05:07 am
Up
Destajador
User
Offline Off
Well, some time ago you had one that contained your mod. I thought you had it online
Quote:
In the other hand, this community still has sides that I don't like such as: http://www.unrealsoftware.de/forum_posts.php?post=22135&start=1480#post414577


I think that day I was in a bad mood :V
anyway for your answers, I think it affected you too much my comment.
do not be spiteful
To the start Previous 1 Next To the start