Finding Next Available Number
#2

Something like this, maybe?

pawn Код:
for(new i = 0; i < MAX_SAVED_VEHICLES; i++)
{
    format(string, sizeof(string), "%d.INI", i);
    if(!fexist(string)) return i;
}
EDIT: Made a few efficiency adjustments.
Reply


Messages In This Thread
Finding Next Available Number - by nmader - 25.03.2013, 17:05
Re: Finding Next Available Number - by Scenario - 25.03.2013, 17:10
Re: Finding Next Available Number - by nmader - 25.03.2013, 17:13
Re: Finding Next Available Number - by Scenario - 25.03.2013, 17:15
Re: Finding Next Available Number - by nmader - 25.03.2013, 17:17
Re: Finding Next Available Number - by park4bmx - 25.03.2013, 17:29
Re: Finding Next Available Number - by Scenario - 25.03.2013, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)