GetFreeVehicleSlot
#9

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


Messages In This Thread
GetFreeVehicleSlot - by Stefand - 04.06.2013, 15:39
Re: GetFreeVehicleSlot - by nmader - 04.06.2013, 16:52
Re: GetFreeVehicleSlot - by Stefand - 04.06.2013, 16:57
Re: GetFreeVehicleSlot - by Pooh7 - 04.06.2013, 17:08
Re: GetFreeVehicleSlot - by Stefand - 04.06.2013, 17:09
Re: GetFreeVehicleSlot - by Stefand - 04.06.2013, 17:16
Re: GetFreeVehicleSlot - by nmader - 04.06.2013, 17:27
Re: GetFreeVehicleSlot - by Stefand - 04.06.2013, 17:44
Re: GetFreeVehicleSlot - by Stefand - 04.06.2013, 18:23
Re: GetFreeVehicleSlot - by Stefand - 04.06.2013, 18:34

Forum Jump:


Users browsing this thread: 2 Guest(s)