CrosRoad95 Posted April 5, 2017 Share Posted April 5, 2017 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 botder Posted April 5, 2017 MTA Team Share Posted April 5, 2017 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
MTA Team botder Posted April 5, 2017 MTA Team Share Posted April 5, 2017 Unable to edit my previous post. Anyway, there are two functions, which might do what you want: saveMapData and loadMapData Link to comment
Recommended Posts