• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Server] Loop skipping (Creating only odd numbers)
#3
(2021-10-11, 03:09 PM)Radical Wrote: 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);

lmao.
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply


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

Forum Jump: