HeavyMetal Posted February 16, 2013 Share Posted February 16, 2013 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
Scooby Posted February 17, 2013 Share Posted February 17, 2013 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
Shazzimal Posted February 17, 2013 Share Posted February 17, 2013 Where can i learn the SQL scripting, i've now got enough scripting knowledge so i think i can go one step further? Link to comment
Moderators IIYAMA Posted February 17, 2013 Moderators Share Posted February 17, 2013 I have also never used it before, but I saw some functions on wikimta: https://wiki.multitheftauto.com/wiki/Ser ... _Functions 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