bandi94 Posted August 11, 2013 Share Posted August 11, 2013 IDK why the hell is not working. So is about a bank system. Putting money in. local table_d = getAccountData(acc,"deposits") if not table_d then table_d = {} end local time = getRealTime() local day_c = getDayCount(time.year,time.month,time.monthday) table_d[#table_d+1] = {value = value_d , day = (day+day_c)} setAccountData(acc,"deposits",table_d) setAccountData(acc,"penz",money-value) triggerClientEvent(source,"upShowMsg",source,"Successfully deposited !") No error even the msg is showed(+ my money is taken). After sending the table to client. local table_d = getAccountData(acc,"deposits") if not table_d then outputChatBox("there is no table") table_d = {} end local time = getRealTime() local day_c = getDayCount(time.year,time.month,time.monthday) triggerClientEvent(source,"updateDepositTable",source,table_d,day_c) Where i get the outputChatBox , that there is no table .... thefuck. Both of them are server sided. Trigger'ed from client side whit getLocalPlayer() , putting it with button , sending table when window is opened(ofc after i put the money in i closed the window and re opened it) Link to comment
Castillo Posted August 11, 2013 Share Posted August 11, 2013 You can't store lua tables as account data, convert the table to a JSON string with toJSON. Link to comment
bandi94 Posted August 11, 2013 Author Share Posted August 11, 2013 pffff . THX , now is working Link to comment
Castillo Posted August 11, 2013 Share Posted August 11, 2013 You're welcome. Remember, account data has a limit, so, if your JSON is too long, parts of it will be cut off. Link to comment
bandi94 Posted August 11, 2013 Author Share Posted August 11, 2013 (edited) yah , after 5 deposit's after converting back the JSON , i got " in pars table got nil " pfffff. Edited August 11, 2013 by Guest Link to comment
Castillo Posted August 11, 2013 Share Posted August 11, 2013 Is because the last part of the JSON is gone. Link to comment
bandi94 Posted August 11, 2013 Author Share Posted August 11, 2013 My problem is that i need to save every deposit alone. Every deposit has a time in witch you cannot withdraw it . I used it like. table= {value=.... , day = ........ } if i use it like table={value,day} --without data name it will save some space right ?? Or for the best solution i should use 2 Table one holding the money , secound one holding day count . ? And before saving i will check the leght. (do you know witch is the limit ??). Link to comment
Castillo Posted August 11, 2013 Share Posted August 11, 2013 You'll have to use SQLite or MySQL. Link to comment
bandi94 Posted August 11, 2013 Author Share Posted August 11, 2013 ok , then it's time to learn SQLite Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now