23.04.2012, 18:58
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.
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.