break in loop
#1

'break' in this loop doesn't seem to be doing what i want it to do.

pawn Код:
for(new i = 1; i < sizeof(HouseData); i++)
            {
                if(HouseData[i][Created] == 0) houseid = i;
                break;
            }
So obviously I have it start at 1, because I don't want a houseid to be 0, the first time it works fine and houseid ends up being 1, but after that, it keeps being 0, instead of 2, 3 etc.

If I don't use break, the houseid starts from 499 and descends (housedata has a limit of 500)
Reply


Messages In This Thread
break in loop - by Jack_Leslie - 16.07.2014, 10:30
Re: break in loop - by Vince - 16.07.2014, 10:32
Re: break in loop - by Jack_Leslie - 16.07.2014, 10:39
Re: break in loop - by Stanford - 16.07.2014, 10:55
Re: break in loop - by Jack_Leslie - 16.07.2014, 10:58

Forum Jump:


Users browsing this thread: 1 Guest(s)