2021-10-11, 03:09 PM
Nothing wrong with loop but you can use Iter_Free(). That's better.
Replace this
With
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);