Posts: 139
Threads: 26
Joined: Oct 2009
Reputation:
0
Few days ago i tried to make a vehicle buying system with dialogs, everything went well but i dont know how to make the cars save, because it just creates a vehicle with CreateVehicle when you buy, i need help how to save them or how to load them on spawn and delete on disconnect or something that's good.
Posts: 62
Threads: 1
Joined: Jan 2011
Reputation:
0
I'd suggest you to let the cars stay when they disconnect, but about your question, i dont really know >.<
Posts: 139
Threads: 26
Joined: Oct 2009
Reputation:
0
But when i restart the server , then the cars will disapear and then they have to buy a new one, so i dont know, there has to be a better way.
Posts: 810
Threads: 34
Joined: Nov 2007
Reputation:
0
edit out the LoadVehiclesFromFile in grandlarc (included with server package) and load them through that, save them in the same file and add some extra's like owner and price or something. (im actually too lazy to do this for you, but this would get you started)
Posts: 139
Threads: 26
Joined: Oct 2009
Reputation:
0
Well i got the vehicles loading from .txt file but i need help with saving after buying from dialog,
like it creates a vehicle when buying from dialog , and somehow i dunno it needs to write it to the file
Anybody help?
Posts: 740
Threads: 63
Joined: Oct 2009
Reputation:
0
There are 2 ways to do this
1st) Save the car stats in the player file so you can load it when he login
2nd) Write the file stats into a txt file at your scriptfiles so you load it when the gamemode starts
Posts: 139
Threads: 26
Joined: Oct 2009
Reputation:
0
Well , yeh i can do with enums but i dunno how it will load correctly when im not using Dynamic car system
Posts: 139
Threads: 26
Joined: Oct 2009
Reputation:
0
i Think its easier to load vehicle from file, and save car into file when player bought/spawned
Posts: 740
Threads: 63
Joined: Oct 2009
Reputation:
0
Check LARP car dealership, This may help you mate