English couldnt find delete topic button, sorry

26 replies
Goto Page
To the start Previous 1 2 Next To the start
15.08.12 06:41:36 pm
Up
EP
User
Offline Off
@user Infinite Rain: Also, what you call a table is an array with some vectors.
15.08.12 06:42:51 pm
Up
Infinite Rain
Reviewer
Offline Off
user VADemon has written:
Array itself isn't that bad. Worser is, that it's a global.
file too.

Amen to that words.
@user EP:
I know that, but I think my way will be much times better because way to save everything will be much easier.
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
15.08.12 06:44:36 pm
Up
loldlold123
User
Offline Off
damn then tell me what i should use stop telling WHY ARE YOU USING ARRAY cookie

also its not about array,its about save & load please, help me about that -.-"


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
function saves(id)
     if player(id,"usgn")~=0 and id>0 and id<33 then
file = io.open("allsavedatas/arraysaves/"..player(id,"usgn")..".txt","w+")
file:write(tostring(career[id]).." "..tostring(money[id]).." "..tostring(aclik[id]).." "..tostring(referer[id]).." "..tostring(jail[id]).." "..tostring(saycolor[id]).." "..tostring(mute[id]).." "..tostring(locked[id]).." "..tostring(commandcooldown[id]).." "..tostring(shootingrange[id]))
file:close()
msg2(id,'©107142035Save Game Successfull!@C')
end
end

      player_dat={}
function loads(id)
     if player(id,"usgn")~=0 and id>0 and id<33 then
          for line in io.lines("allsavedatas/arraysaves/"..player(id,"usgn")..".txt") do
               player_dat[id]={line:match("(.*) (.*) (.*) (.*) (.*) (.*) (.*) (.*) (.*) (.*)")}
                  career[id]=tonumber(player_dat[id][1])
                  money[id]=tonumber(player_dat[id][2])
                  aclik[id]=tonumber(player_dat[id][3])
                  referer[id]=tonumber(player_dat[id][4])
                  jail[id]=tonumber(player_dat[id][5])
                  saycolor[id]=tonumber(player_dat[id][6])
                  mute[id]=tonumber(player_dat[id][7])
                  locked[id]=tonumber(player_dat[id][8])
                  commandcooldown[id]=tonumber(player_dat[id][9])
                  shootingrange[id]=tonumber(player_dat[id][10])
          end
     end
end


that code works

but still LUA ERROR: sys/lua/savenload.lua:3: attempt to concatenate a boolean value
edited 3×, last 16.08.12 12:12:46 am
16.08.12 02:29:24 am
Up
xSkyLordx
User
Offline Off
Why do you always SHIT factis ?
16.08.12 08:43:48 am
Up
EngiN33R
Moderator
Offline Off
Try putting a debug message to print(tostring(player(id,"usgn")))? Also, the if statement on the second line, try changing it to that:
Code:
1
if player(id,"usgn") and player(id,"usgn")~=0 and id>0 and id<33 then
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
16.08.12 10:20:11 am
Up
loldlold123
User
Offline Off
@user EngiN33R:
no more error
19.08.12 08:31:39 pm
Up
omg
User
Offline Off
why is file a global? that bugs me so much
will code for food
To the start Previous 1 2 Next To the start