Jump to content

[OK] Add cash to an Account !


=KoG=Rouche

Recommended Posts

Hello all,

Here is a part of my code but the script return me this message "Error with theData !"

I don"t understand why "theData" is not ok in my script :-/

  
function quarterHour() 
    local account = getPlayerAccount(source) 
    local theData = getAccountData(account, "cash") 
    local x = 500 
    if( theData )then 
        setAccountData(account, "cash", tonumber(theData) + tonumber(x)) 
    else 
        outputChatBox("Error with theData !") 
    end 
end 
  

Thanks for help.

Edited by Guest
Link to comment
What is "account data" ? 0.o

I checked MTA Classes about Account and there is nothing about predefined variables :-/

Is cash a predefined variables ?

Or i must create it ? But how can this be saved on the account player ?

Predefined variable? wtf

cash is not even a variable, it's a string key used to stored/retrieved string.

Did you ever read the wiki?

https://wiki.multitheftauto.com/wiki/SetAccountData

https://wiki.multitheftauto.com/wiki/GetAccountData

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...