Posts: 1,905
Threads: 63
Joined: Oct 2011
Reputation:
0
Hello, I've been working on a dynamic vehicle system, I've got the writing, and loading done fine, but now I need the deleting part to get down. So how would I loop through all the files, and delete one? I've thought about writing a string such as a name, but that would get hectic if the name already existed. Any ideas?
Posts: 40
Threads: 1
Joined: Oct 2011
Reputation:
0
What file saving are you using for it?
Posts: 79
Threads: 0
Joined: Apr 2012
Reputation:
0
show us your code... maybe use mysql/sqlite
Posts: 40
Threads: 1
Joined: Oct 2011
Reputation:
0
Well I just save my files to a directory within the script files. For instance Vehicles. And create files through script that save v1.ini and v2.ini and so forth. Then you can loop through every file with MAX_VEHICLES and delete ones that already exist. I use this for dynamic vehicles, houses, businesses, and everything else. It works flawlessly.
Posts: 1,905
Threads: 63
Joined: Oct 2011
Reputation:
0
I could do what you said above, but it wouldn't really be practical to have a file per car. I'll figure it out. I'm using sscanf, and the default file functions.
Posts: 40
Threads: 1
Joined: Oct 2011
Reputation:
0
Well it works if you save paint colors, mods, owners of the vehicle and such to it. If it's just the coordinates then it might not be as helpful. I just used it for dynamic faction vehicles.