Posts: 966
Threads: 5
Joined: Jul 2011
Reputation:
0
Ballu Miaa, that is not what he's trying to do. Read the topic title, it mentions looping through all existing dini files to spawn players' vehicles. However, getting a directory listing is impossible using SA-MP native functions. A plugin is required to retrieve the files in a directory.
You could somehow modify your server infrastructure to lets say, contain vehicle data in a file like "scriptfilers/Vehicles/1.txt", then 2.txt and so forth. This would actually let you "predict" the file names. Still, such file parsing is rather slow (and I don't recommend looping through these files during regular runtime activity, perhaps on gamemode load only). Alternatively I might suggest using SQLite or MySQL for storing the data like this.
Posts: 970
Threads: 16
Joined: Aug 2009
Reputation:
0
That is rather impossible. You can't loop through user files and open them. What you can do, save the vehicles in a different folder, in order (File name like: 1.ini; 2.ini; 3.ini; 4.ini; 5.ini; etc etc). That way you can loop through all files and open one at a time.