raynner Posted June 2, 2017 Share Posted June 2, 2017 Hello everyone Good I'm fine tuning a script and related to buying vehicles for my good RPG server I some time ago did a tuning shop that you can buy modifications for your vehicle and this implies handling the same and I would like that script saves the handling Current when the car is removed from the map (destroyElement) and as soon as it is added back to the map (spawned) it already comes up with its handling it is sort of an export and import script uses .db file to store vehicle information Can anyone give me a good light I know I should use getVehicleHandling plus n I know how to manipulate the table it returns me! sorry for my English Link to comment
idarrr Posted June 2, 2017 Share Posted June 2, 2017 Yeah, so i use something like this on my server. local handling = toJSON(getVehicleHandling(vehicle)) -- You can insert handling variable to db And when you need to get that handling data, use this. local handling = fromJSON(row.handling) -- This is an example, row.handling is from database for k, v in ipairs(handling) do setVehicleHandling(vehicle, k, v) end Link to comment
raynner Posted June 2, 2017 Author Share Posted June 2, 2017 5 hours ago, idarrr said: Yeah, so i use something like this on my server. local handling = toJSON(getVehicleHandling(vehicle)) -- You can insert handling variable to db And when you need to get that handling data, use this. local handling = fromJSON(row.handling) -- This is an example, row.handling is from database for k, v in ipairs(handling) do setVehicleHandling(vehicle, k, v) end Well I did not quite understand the row. But I'll try it here and I hope that right now thanks for the help <3 Link to comment
raynner Posted June 2, 2017 Author Share Posted June 2, 2017 6 hours ago, idarrr said: Many thanks I managed to make it work, only with a differential I had to use pairs and not ipairs .. more anyway helped a lot. Thank you Link to comment
idarrr Posted June 2, 2017 Share Posted June 2, 2017 1 minute ago, raynner said: Many thanks I managed to make it work, only with a differential I had to use pairs and not ipairs .. more anyway helped a lot. Thank you NP mate. Link to comment
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