12.01.2012, 16:14
I wanted to get the houses loaded the console says they are loaded and if they are... Where are the icons? Anyone sees a problem in here?
pawn Код:
LoadHouses()
{
new ExtX[11], ExtY[11], ExtZ[11];
print("Houses are being loaded");
mysql_query("SELECT NULL FROM Houses");
mysql_store_result();
new rows = mysql_num_rows();
mysql_free_result();
CheckMySQL();
for(new i; i < rows; i++)
{
new string[128];
format(string, sizeof(string), "SELECT * FROM Houses WHERE HouseID = '%d'", i);
mysql_query(string);
mysql_store_result();
new row[128];
new field[11][24];
mysql_fetch_row_format(row, "|");
explode(row, field, "|");
mysql_free_result();
mysql_fetch_field_row(AHouseData[i][ID], "HouseID");
mysql_fetch_field_row(AHouseData[i][price], "Houseprice");
mysql_fetch_field_row(AHouseData[i][Owner], "Houseowner");
mysql_fetch_field_row(ExtX, "X");
mysql_fetch_field_row(ExtY, "Y");
mysql_fetch_field_row(ExtZ, "Z");
AHouseData[i][HouseX] = floatstr(ExtX);
AHouseData[i][HouseY] = floatstr(ExtY);
AHouseData[i][HouseZ] = floatstr(ExtZ);
if(strlen(AHouseData[i][Owner]) > 0) CreatePickup(1273, 1, AHouseData[i][HouseX], AHouseData[i][HouseY], AHouseData[i][HouseZ], -1);
else CreatePickup(1272, 1, AHouseData[i][HouseX], AHouseData[i][HouseY], AHouseData[i][HouseZ], -1);
printf("House %d created", i);
}
print("Loading finished");
}