• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Server] Loop skipping (Creating only odd numbers)
#2
Nothing wrong with loop but you can use Iter_Free().?That's better.



Replace this

Code:
new found = 0;

for(new i = 1; i < MAX_HOUSES; i)

{

if(HouseInfo[i][hID] == 0 && found == 0)

{

? ? found;

? ? UID = i;

format(text, sizeof(text), "House id is %d", UID);

SendClientMessage(playerid, -1, text);

}

}



With

Code:
UID = Iter_Free(HouseIterator);

? ? if(UID == -1) return error(playerid, "Cannot create more houses. ");



? ? format(text, sizeof(text), "House id is %d", UID);

? ? SendClientMessage(playerid, -1, text);
  Reply


Messages In This Thread
RE: Loop skipping (Creating only odd numbers) - by Radical - 2021-10-11, 03:09 PM

Forum Jump: