Jump to content

[HELP] Save


DiGiTal

Recommended Posts

Posted (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 by Ridden
Posted

@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?

Posted

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
  • Forum Administrators
Posted

@DonOmar that doesn't save anything, it simply turns a table into JSON format. If the resource restarts then you've lost the data.

  • Thanks 2
Posted
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

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