Jump to content

somethink like dump element to string


Recommended Posts

On every server function to save vehicles, players etc take a lot of code, you must loop all datas, position, handling etc.

good idea is to make function like dump(element) which return all element possible thinks as string, and second function element=loadFromDump(string) which load element from this string

this could be use for vehicle and players.

Link to comment
  • MTA Team

What you want is data serialization. There are different ways to store information e.g. in files, in memory, in databases etc. You should consider that other servers might want to store other useful information about elements (e.g. you might store the owner of the vehicle) and each of these servers use a different method to store the information. You have the Lua language and the MTA functions to make your own serialization structure. You can go ahead, make a serialization "library" for MTA and release it for others.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...