Jump to content

Need help with data "code"


HeavyMetal

Recommended Posts

im making a script that add a new "upgrade" for the cars and i want to relate it with the data (the code that appears when you use getPedOccupiedVehicle) to indentify what car have it or not, but when i use a script to save all vehicles before turning the server off, when they spawn again it create a identical vehicle with other code, and i want to know if there is a function or a way to set that code back to the old one, so the cars saved with the upgrade keep it.

or if is there any other way of saving it without having to use this code please tell me.

thanks

Link to comment

you would need to save the data with sql or xml so when u restart the server it creates the cars from the saved data

in the correct place with the previous upgrades.

its not a big job, just loop through ur vehicles on resource stop, save x,y,z,rotx,roty,rotz,id+ any upgrades,

then on start, load the vehicles from where you saved them and create again with the saved data.

so really u just need to make load/save functions for ur vehicles.

this could just mean a slight modification to ur current save vehicle script... although im not sure what ur using now.

all unsaved data is lost when the server is shutdown... saving is the only way.

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