Forum

> > CS2D > Scripts > load money bug plz fix
Forums overviewCS2D overview Scripts overviewLog in to reply

English load money bug plz fix

11 replies
To the start Previous 1 Next To the start

old load money bug plz fix

lagger33
User Off Offline

Quote
plz help me, i cant load my database, so if i start the game the money default again (100)
here is the lua
1)addhook join
Spoiler >

2) save & load lua
Spoiler >

how to connect the first lua with second lua?
the save is working , but not with the load
in other thread i know put the
Spoiler >

to the
Spoiler >

but i dont know put it where
sorry im newbie lua editor
please tell me where i should put them

old Re: load money bug plz fix

uaiek
User Off Offline

Quote
Simply copy and paste the second script at the end of the first script.

Like this
Spoiler >

old Re: load money bug plz fix

lagger33
User Off Offline

Quote
user uaiek has written
Simply copy and paste the second script at the end of the first script.

Like this
Spoiler >

still not working, money still bug, can save cant load

old Re: load money bug plz fix

lagger33
User Off Offline

Quote
user uaiek has written
Run your server again and look at the console and tell the red LUA ERROR.

no lua error just not working, the money still 100 (default) each game start

old Re: load money bug plz fix

Chingy
User Off Offline

Quote
Use your brain and think yourself about it why it doesn't work. God damn it I can't just ignore those kids who know a shit about starting a server but still want to do it.

old Re: load money bug plz fix

Chingy
User Off Offline

Quote
user Eternal has written
Have you try it with dedicated server? if no , try this dedicated server out , for Windows and for Linux and then tell us your result.

I guess he has Windows. Every idiot which don't know how to use a computer correctly uses Windows.

old Re: load money bug plz fix

Gaios
Reviewer Off Offline

Quote
Quote
still not working, money still bug, can save cant load

> See what the program is written to the file.

Maybe load bug.
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
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
          elseif tonumber(parses[2]) ~= nil then
               rp_license[id] = tonumber(parses[2])
          elseif 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

old Re: load money bug plz fix

MikuAuahDark
User Off Offline

Quote
from the code, im know that he use file File does not exist (4733). here some solution:
1. Create folder at <cs2ddirectory>\sys\lua called "rp_citylife"(without quotes)
2. Try to start as administrator if you install it at Program Files and if you using windows7
3. Iif both above still not working, well try a code above my post.

but i see from your code(user lagger33) it should work fine so solution 1 or 2 should fix your problem
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview