Loop not working <.<
#4

pawn Код:
for(new i, f = MAX_HOTDOGZONES; i < f; i++)
    {
        if(!IsPlayerInRangeOfPoint(i,5.0,HotDogPlace[i][0],HotDogPlace[i][1],HotDogPlace[i][2])) count++;
            else break;
        if(count == MAX_HOTDOGZONES//+1) {SendClientMessage(playerid, Red, "« Error »"lyellow"You aren't near a hotdog stand!");break;}
    }
The loop will work as long as i < f , not equals to f

then you checked if count is equals to max_hotdogzones, but it will never be equal to it ...


So you should check for the max zones or whatever +1

Another thing i noticed, is that u used playerif instead of i
Reply


Messages In This Thread
Loop not working <.< - by FireCat - 30.11.2011, 14:10
Re: Loop not working <.< - by FireCat - 30.11.2011, 14:26
Re: Loop not working <.< - by wumpyc - 30.11.2011, 14:34
Re: Loop not working <.< - by ElkaBlazer - 30.11.2011, 15:52
Re: Loop not working <.< - by Finn - 30.11.2011, 15:58
Re: Loop not working <.< - by [MWR]Blood - 30.11.2011, 16:02
Re: Loop not working <.< - by [MG]Dimi - 30.11.2011, 16:06
Re: Loop not working <.< - by FireCat - 30.11.2011, 16:20

Forum Jump:


Users browsing this thread: 1 Guest(s)