[HELP] Loading Vehicles
#7

YSF plugin needed.

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;
}
And to read:

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;
}
-Conroy
Reply


Messages In This Thread
[HELP] Loading Vehicles - by Maxips2 - 24.08.2010, 10:27
Re: [HELP] Loading Vehicles - by Hiddos - 24.08.2010, 10:47
Re: [HELP] Loading Vehicles - by Maxips2 - 24.08.2010, 10:51
Re: [HELP] Loading Vehicles - by vection - 24.08.2010, 11:23
Re: [HELP] Loading Vehicles - by Maxips2 - 24.08.2010, 17:15
Re: [HELP] Loading Vehicles - by playbox12 - 24.08.2010, 17:51
Re: [HELP] Loading Vehicles - by Conroy - 24.08.2010, 18:03
Re: [HELP] Loading Vehicles - by Maxips2 - 24.08.2010, 18:15
Re: [HELP] Loading Vehicles - by Conroy - 24.08.2010, 18:21
Re: [HELP] Loading Vehicles - by Maxips2 - 24.08.2010, 18:27

Forum Jump:


Users browsing this thread: 1 Guest(s)