Jump to content

Complicated saving


Derpy

Recommended Posts

hello, i would like to save following thing permanently(nothing is permanent but something long-keeping like setAccountData)

lets say i got 4 slots and upgrades(multiple of them)

and on these 4 slots 4 vehicles can be saved.

so how could i save specific vehicle's upgrades permanently to the vehicle which is saved to person?

if you didn't understand then here's usage of it if it'd be done of course:

you got 4 different cars saved on 4 different slots, and all cars have their own different upgrades.

you want to spawn car and make it have it's custom upgrades which you saved to it.

but there are alot of numbers in here, from upgrade id's to vehicle IDs and i am not sure anymore how could i save all of this without all data being conflicted.

i hope that you understand me, otherwise ask me to explain better

please help me, and thanks in advance.

Link to comment

thanks, i will try to learn SQL and accomplish this.

still there are a lot of IDs(from model(vehicle) IDs to upgrade IDs)

how could i store the data without worrying of it being conflicted?

like if i had elegy tuned all differently on 4 slots, how could i save the data to elegy, but to each elegy different data to avoid conflicts?

Link to comment
thanks, i will try to learn SQL and accomplish this.

still there are a lot of IDs(from model(vehicle) IDs to upgrade IDs)

how could i store the data without worrying of it being conflicted?

like if i had elegy tuned all differently on 4 slots, how could i save the data to elegy, but to each elegy different data to avoid conflicts?

This is one of possibilities ,

When car is created or bought. You take owner name + random integer and set is as car_id.

Or you can just make the same thing with out owner and you random integer but you need to check if that random integer is not is use already.

setElementData(vehicle,"car_id",car_id)

than just retriev element by car_id and add new values, create column in sql with car_id + other data attached to it, and select data and vehicle by it's car_id

Link to comment
thanks, i will try to learn SQL and accomplish this.

still there are a lot of IDs(from model(vehicle) IDs to upgrade IDs)

how could i store the data without worrying of it being conflicted?

like if i had elegy tuned all differently on 4 slots, how could i save the data to elegy, but to each elegy different data to avoid conflicts?

This is one of possibilities ,

When car is created or bought. You take owner name + random integer and set is as car_id.

Or you can just make the same thing with out owner and you random integer but you need to check if that random integer is not is use already.

setElementData(vehicle,"car_id",car_id)

than just retriev element by car_id and add new values, create column in sql with car_id + other data attached to it, and select data and vehicle by it's car_id

Any MYSQL table can have an integer value with AUTOINCREMENT, means it automatically assigns IDs. Getting random number is not necessary.

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