SA-MP Forums Archive
SaveDynamicCars bug... - 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: SaveDynamicCars bug... (/showthread.php?tid=79121)



SaveDynamicCars bug... - Castle - 25.05.2009

Ok, Heres my problem.
I add a car IG /addcar 560 1 1 here what is does:
Cleans the cars.cfg file.
saves the new added cars on first line and than saves another 84 cars by some sort weird ids: 2,4,6,8,10,12 kinda jumps cars.
What I want to do is to save the new added car in the end of the file with out removing teh already saved cars.

heres the SAVE pastebin: http://pastebin.com/f7e6fe2db
and heres the Check thingy under OnGameModeInit: http://pastebin.com/f7c2ee4b6
Now I kinda battled it for a long time, Can't find a solution... anyone can Help or give some tip?


Re: SaveDynamicCars bug... - Weirdosport - 25.05.2009

I seem to remember someone telling me to use \r\n as opposed to just \n, but I can't remember entirely what \r does or where to find it on the wiki


Re: SaveDynamicCars bug... - Castle - 25.05.2009

ill try that, thanks


Re: SaveDynamicCars bug... - Correlli - 25.05.2009

Quote:
Originally Posted by wiki.sa-mp.com
A little explanation about the escape codes; the "\n" will begin a new line, and the \r makes sure it starts at the beginning, not somewhere in the middle of a line, so it wont end up like:
Name1
Name2
https://sampwiki.blast.hk/wiki/File_Functions


Re: SaveDynamicCars bug... - Weirdosport - 25.05.2009

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by wiki.sa-mp.com
A little explanation about the escape codes; the "\n" will begin a new line, and the \r makes sure it starts at the beginning, not somewhere in the middle of a line, so it wont end up like:
Name1
Name2
https://sampwiki.blast.hk/wiki/File_Functions
Thanks Don, knew there was a reason for it :P And that it was somewhere on the wiki...


Re: SaveDynamicCars bug... - Correlli - 25.05.2009

Quote:
Originally Posted by Weirdosport
Thanks Don, knew there was a reason for it :P And that it was somewhere on the wiki...
You're welcome. Yes, everything's there. :P