24.08.2010, 18:03
YSF plugin needed.
And to read:
-Conroy
pawn Код:
stock ReturnNextVehicleFileName()
{
new filename[40], filepath[40], i, filenumber[40], lastint = 0000;
while(ffind("LVRP/Vehicles/*", filename, 64, i)) {
strmid(filenumber, filename, 3, 7);
lastint = strval(filenumber)+1;
format(filepath, sizeof(filepath), "LVRP/Vehicles/Veh%04d.ini", lastint);
if(!dini_Exists(filepath)) return lastint;
}
return lastint;
}
pawn Код:
new filename[40], i, filepath[128];
while(ffind("LVRP/Vehicles/*", filename, 64, i))
{
format(filepath, sizeof(filepath), "LVRP/Vehicles/Veh%04d.ini", lastint);
// This will loop through all the .INI files in the 'Vehicles' folder, use filepath for each vehicle starting from 0000 upwards.
return lastint;
}