Question about variables
#4

You can use this code:
pawn Code:
stock GetFreeHouseID()
{
    new file[128];
    for(new h = 0;h < 800; h++)
    {
        format(file, sizeof(file), "/Houses/%d.ini", h); // You will have to rename this to your own file destination
        if(!dini_Exists(file))
        {
            return h;
        }
    }
    return -1;
}
But that will check, whats the next ID of a house. So, you will have to name them like 00.ini, 01.ini and so on...
Reply


Messages In This Thread
Question about variables - by blackwave - 07.01.2011, 01:36
Re: Question about variables - by JaTochNietDan - 07.01.2011, 01:45
Re: Question about variables - by blackwave - 07.01.2011, 01:47
Re: Question about variables - by Alex_Valde - 07.01.2011, 01:58

Forum Jump:


Users browsing this thread: 1 Guest(s)