Question about consecutive files
#3

Use this to get the next available vehicle ID:

pawn Код:
for(new vehicleIndex, fileName[10]; vehicleIndex < MAX_VEHICLES; vehicleIndex++)
{
    format(fileName, sizeof(fileName), "%d.ini", vehicleIndex);

    if(!file_exists(fileName))
    {
        // Use the ID stored in vehicleIndex
        return 1;
    }
}

// No slots available
Reply


Messages In This Thread
Question about consecutive files - by MMickey - 04.07.2013, 11:35
Re: Question about consecutive files - by MMickey - 05.07.2013, 07:36
Re: Question about consecutive files - by SuperViper - 05.07.2013, 15:53

Forum Jump:


Users browsing this thread: 2 Guest(s)