bandi94 Posted August 11, 2013 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)
Castillo Posted August 11, 2013 Posted August 11, 2013 You can't store lua tables as account data, convert the table to a JSON string with toJSON.
Castillo Posted August 11, 2013 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.
bandi94 Posted August 11, 2013 Author 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
bandi94 Posted August 11, 2013 Author 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 ??).
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