Jump to content

Save vehicle data


SimpleNoob

Recommended Posts

Hello, im working in a vehicle system and i want to save the players vehicle in a file (im thinking on xml or json) and dont remove it when the admin's script restart. My script is getting the players vehicle, but how i can save it into a table and send the table into json? and later to get it and do a loading of that vehicles when the script starts?

Im really dont know how to save that vehicles without creating it from 0.

Thanks for all and sorry for the bad english :c

Link to comment

Sorry for the double post, how i can get all the data into one child? i have this created

    "test">
    "test2">
    "bull">

  

with this

function setFileChild(player,cmd,data) 
            local node = xmlLoadFile("vehicle.xml") 
            local subnode = xmlCreateChild(node,"vehicle") 
            local sucess = xmlNodeSetAttribute(subnode,"vehicletest",data) 
            xmlSaveFile(node) 
            xmlUnloadFile(node) 
end 
addCommandHandler("data",setFileChild) 

how can get all into "vehicle" child and output all?

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