29.05.2016, 11:52
Quote:
why don't you just use row count? it is harder to count an array. you'll have to loop through all elements until it reaches an unused cell.
|
Just loop thru your houses and skip unused cells/rows. My simple trick is to check if houses entrance Z is 0 or if label/icon is invalid. Simple example:
pawn Код:
stock CountHouses()
{
new count = 0;
for(new i = 0; i < MAX_HOUSES; i++)
{
if(HouseInfo[i][EntZ] != 0.0) count++;
}
return count;
}