23.01.2014, 23:20
Any suggestion how to check if money is greater than the house price without loop? Or I create another loop above this one?
Plus, is there anyway I can covert those loops to foreach ones?
Thanks for replies!
+rep
EDIT: I realized it doesn't load the houses actually. Can't figure out what is wrong.
Plus, is there anyway I can covert those loops to foreach ones?
Thanks for replies!
+rep
EDIT: I realized it doesn't load the houses actually. Can't figure out what is wrong.
pawn Код:
stock LoadHouses()
{
new id = 1;
while(id < MAX_HOUSES)
{
format(query,sizeof(query),"SELECT * FROM `houses` WHERE `id` = '%d'",id);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows())
{
if(mysql_fetch_row_format(query,"|"))
{
sscanf(query,"p<|>fffis[128]ii",HouseInfo[id][hX],HouseInfo[id][hY],HouseInfo[id][hZ],HouseInfo[id][hInt],HouseInfo[id][hName],HouseInfo[id][hPrice],HouseInfo[id][hMoney]);
CreateHouse(HouseInfo[id][hX],HouseInfo[id][hY],HouseInfo[id][hZ],HouseInfo[id][hInt],HouseInfo[id][hName],HouseInfo[id][hPrice]);
HouseInfo[id][hIcon] = CreateDynamicMapIcon(HouseInfo[id][hX],HouseInfo[id][hY],HouseInfo[id][hZ],31,-1,-1,-1,-1,50.0);
}
}
id++;
}
return 1;
}

