DiGiTal Posted August 9, 2017 Posted August 9, 2017 (edited) Hi, What can i do if somone do a action as buy a skin of infernus texture. when he come back he will find his texture. Thanks Edited August 9, 2017 by Ridden
DonOmar Posted August 9, 2017 Posted August 9, 2017 I don't understand you but you can use [ setAccountData ] 1
DiGiTal Posted August 9, 2017 Author Posted August 9, 2017 @DonOmar for Example: when a play changed the color of his car to Blue(The color of his car changed but when he reconnect , he will not see the blue Color). I mean a save system when he reconnect. his data it will be stored. SQL Can?
Forum Administrators Lpsd Posted August 9, 2017 Forum Administrators Posted August 9, 2017 Just look at the example of the function he gave you on the Wiki, https://wiki.multitheftauto.com/wiki/SetAccountData Yes, you can use SQL. Use MTA's SQL functions, starting with https://wiki.multitheftauto.com/wiki/DbConnect 1
DonOmar Posted August 9, 2017 Posted August 9, 2017 this is a simple code to save : local redfirst,greenfirst,bluefirst,redsecond,greensecond,bluesecond,redthird,greenthird,bluethird,redfourth,greenfourth,bluefourth = getVehicleColor(veh, true) local color = toJSON({redfirst,greenfirst,bluefirst, redsecond,greensecond,bluesecond, redthird,greenthird,bluethird, redfourth,greenfourth,bluefourth}) and this is a code to load the color: local redfirst,greenfirst,bluefirst,redsecond,greensecond,bluesecond,redthird,greenthird,bluethird,redfourth,greenfourth,bluefourth = unpack(fromJSON(color)) setVehicleColor(veh, redfirst,greenfirst,bluefirst,redsecond,greensecond,bluesecond,redthird,greenthird,bluethird,redfourth,greenfourth,bluefourth) 1
Forum Administrators Lpsd Posted August 9, 2017 Forum Administrators Posted August 9, 2017 @DonOmar that doesn't save anything, it simply turns a table into JSON format. If the resource restarts then you've lost the data. 2
_DrXenon Posted August 9, 2017 Posted August 9, 2017 3 hours ago, LopSided_ said: @DonOmar that doesn't save anything, it simply turns a table into JSON format. If the resource restarts then you've lost the data. He can save the JSON string as the account data since you can't save tables as an account data... 1
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