Jump to content

[HELP] Save


DiGiTal

Recommended Posts

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) 

 

  • Thanks 1
Link to comment
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...

  • Thanks 1
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...