Forum

> > CS2D > Scripts > Save error...
Forums overviewCS2D overview Scripts overviewLog in to reply

English Save error...

2 replies
To the start Previous 1 Next To the start

old Save error...

loldlold123
User Off Offline

Quote
LUA ERROR: sys/lua/countrylifeluas.lua:2: bad argument #1 to 'player' (number expected, got nil)

1
2
3
4
5
6
function hhsave(id)
          file = assert(io.open("sys/user/"..player(id,"usgn")..".txt","w"))
          file:write(careerpoint[id].." "..money[id].." "..moral[id].." "..plx[id].." "..ctpas[id].." "..tpas[id].." "..pistoll[id].." "..lightl[id].." "..crimepoint[id].." "..shoplicencelevel[id].." "..shoplicencepoint[id])
          file:close()
          msg2(id,'©107142035Save Game Successfull!@C')
end

old Re: Save error...

DC
Admin Off Offline

Quote
tabbing/indenting is missing.

how do you call this function? you have to pass a parameter (a player id). you are obviously not doing that.

old Re: Save error...

loldlold123
User Off Offline

Quote
thx DC i found whats wrong when you said how do you call this function? i call it with minute hook and i wrote twice end after id 1,32 do i edit it and its works...
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview