Dialog vehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog vehicle (
/showthread.php?tid=213895)
Dialog vehicle -
andruz99 - 20.01.2011
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.
Re: Dialog vehicle -
MMiz - 20.01.2011
I'd suggest you to let the cars stay when they disconnect, but about your question, i dont really know >.<
Re: Dialog vehicle -
andruz99 - 20.01.2011
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.
Re: Dialog vehicle -
Think - 20.01.2011
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)
Re: Dialog vehicle -
andruz99 - 20.01.2011
OK il try something
Re: Dialog vehicle -
andruz99 - 20.01.2011
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?
Re: Dialog vehicle -
TouR - 20.01.2011
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
Re: Dialog vehicle -
andruz99 - 20.01.2011
Well , yeh i can do with enums but i dunno how it will load correctly when im not using Dynamic car system
Re: Dialog vehicle -
andruz99 - 20.01.2011
i Think its easier to load vehicle from file, and save car into file when player bought/spawned
Re: Dialog vehicle -
TouR - 20.01.2011
Check LARP car dealership, This may help you mate