15.10.2014, 02:54
(
Последний раз редактировалось Neil.; 18.10.2014 в 06:21.
)
fixed.
public OnHouseLoad()
{
new rows, fields, idx;
cache_get_data(rows, fields, mysql);
if(rows)
{
while(idx < rows)
{
HouseCount++;
houseInfo[HouseCount][slots] = cache_get_field_content_int(idx, "slots");
houseInfo[HouseCount][ownerid] = cache_get_field_content_int(idx, "ownerid");
houseInfo[HouseCount][price] = cache_get_field_content_int(idx, "price");
houseInfo[HouseCount][house_x] = cache_get_field_content_float(idx, "house_x");
houseInfo[HouseCount][house_y] = cache_get_field_content_float(idx, "house_y");
houseInfo[HouseCount][house_z] = cache_get_field_content_float(idx, "house_z");
if(ownerid != -1)
{
mysql_format(mysql, query, sizeof(query), "SELECT username FROM accounts WHERE id = %d", ownerid);
mysql_tquery(mysql, query, "GetNameFromID", "i", ownerid);
}
else
{
houseInfo[HouseCount][ownername] = GetNameFromID(
}
idx++;
}
}
return 1;
}
No, you need to use a loop as there is no function to go to the next row. A while loop works pretty well for this. Try something like this:
pawn Код:
|