05.07.2013, 15:53
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