In the global vars section of your game mode (where MAX_HOUSES is defined) add
pawn Code:
Itter_Create(Houses,MAX_HOUSES);
As a house is created, you need to add it to the Houses itter by doing:
pawn Code:
Itter_Add(Houses,houseid);
House ID of course being whatever you are using to identify the house ID (that is purely an example, make sure you have the houseid var defined if you use it that way).
If you delete or remove a house you must do:
pawn Code:
Itter_Remove(Houses,houseid);
You do not want a house id (or id # for that matter) to double-up in a foreach itter. I speak from experience here. Your server will hit an endless loop and go to 99.9% cpu use.
When you want to loop that Houses itter you would do:
pawn Code:
foreach(Houses,i)
{
//Insert code here
}
Hope that helps. I can expound further on 2D itters though I don't think you'll need that here. 2D itters can be a monster to deal with.