Jump to content

Need help with data "code"


HeavyMetal

Recommended Posts

Posted

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

Posted

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.

ScoobySig.gif

[UVA]Scooby

Founder Of UVA - Ultimate Vice Assassins

http://www.uvaclan.com/

Posted

Where can i learn the SQL scripting, i've now got enough scripting knowledge so i think i can go one step further?

My resources: Didn't make one yet.

n-560x95.png

Momently in build!

  • Moderators
Posted

I have also never used it before, but I saw some functions on wikimta:

https://wiki.multitheftauto.com/wiki/Ser ... _Functions

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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