Jump to content

Idiot weird table problem


bandi94

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...