How to set a number into a file
#1

Hi! I have a vehicle system, and I want to set to each vehicle a different number. That means that for example, I create a new vehicle, and I want to automatically assign it the number 1000, but to the next vehicle I want it to have the following number, which is 1001.

I don't know how to do this, and I want it. Some help?
Reply
#2

Use a loop starting at 1000 ending at 1000+MAX_VEHICLES with a fexist() check inside it with the loop value formatted as the file name. If the file does not exist, create it and break the loop. If it does exist, continue the loop.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)