How to set a number into a file - 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)
+--- Thread: How to set a number into a file (
/showthread.php?tid=634804)
How to set a number into a file -
Antenastyle - 26.05.2017
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?
Re: How to set a number into a file -
Toroi - 26.05.2017
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.