04.06.2013, 18:23
This is what I had when I used Dini files, is there a way to do the same with Mysql?
pawn Код:
stock GetFreeVehicleSlot()
{
new string[40];
for(new i = 0; i < MAX_VEHICLES; i++)
{
format(string, sizeof(string), "Vehicles/Vehicle_%d.ini", i); //format the file
if(fexist(string)) continue; //If the file exists, go to the next file
return i; //If the file doesn't exist, then we have an available slot, and we return the number/value of 'i'
}
return -1; //return -1 or INVALID_VEHICLE_ID for no available files
}