=KoG=Rouche Posted November 2, 2013 Posted November 2, 2013 (edited) 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 November 9, 2013 by Guest
Castillo Posted November 2, 2013 Posted November 2, 2013 Is 'source' defined? did you ever set "cash" account data?
=KoG=Rouche Posted November 2, 2013 Author Posted November 2, 2013 Source is comming from client.lua > localPlayer send to triggerServerEvent I don't understand how work cash in MTA... is it linked to MTA user Account ? For the moment i have a userpanel using "cash" and i try to make a new script using the same cash.
Castillo Posted November 3, 2013 Posted November 3, 2013 And the data is being saved on account data?
=KoG=Rouche Posted November 3, 2013 Author Posted November 3, 2013 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 ?
TAPL Posted November 3, 2013 Posted November 3, 2013 What is "account data" ? 0.oI 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
=KoG=Rouche Posted November 8, 2013 Author Posted November 8, 2013 Must i use givePlayerMoney ? EDIT The givePlayerMoney add money to GTA:SA cash but not in the cash linked to account with the userpanel. Can someone help me ? :-/ EDIT 2 I added my script to existing userpanel and it works fine ! Ty anyway =D
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