19.09.2013, 19:58
Hello, what's wrong with this?
I have two rows made in the Houses table and also have "LoadHouses();" under OnGameModeInit, but the houses do not load and I get this in mysql_log.txt:
pawn Код:
public LoadHouses()
{
new string[300], query[800];
new fetch[2];
mysql_function_query(dbHandle, "SELECT * FROM `Houses`", true, "", "d");
new houseid = 1;
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
while(mysql_fetch_row_format(query,"|"))
{
HouseInfo[houseid][hID] = cache_get_row_int(0, 0, dbHandle);
cache_get_row(0, 1, fetch); HouseInfo[houseid][hAddress] = strval(fetch);
cache_get_row(0, 2, fetch); HouseInfo[houseid][hOwner] = strval(fetch);
HouseInfo[houseid][hOwner] = cache_get_row_int(0, 2, dbHandle);
HouseInfo[houseid][hPrice] = cache_get_row_int(0, 3, dbHandle);
HouseInfo[houseid][hType] = cache_get_row_int(0, 4, dbHandle);
HouseInfo[houseid][hVirtualWorld] = cache_get_row_int(0, 5, dbHandle);
HouseInfo[houseid][hInterior] = cache_get_row_int(0, 6, dbHandle);
HouseInfo[houseid][hPosX] = cache_get_row_float(0, 7, dbHandle);
HouseInfo[houseid][hPosY] = cache_get_row_float(0, 8, dbHandle);
HouseInfo[houseid][hPosZ] = cache_get_row_float(0, 9, dbHandle);
HouseInfo[houseid][hEnterX] = cache_get_row_float(0, 10, dbHandle);
HouseInfo[houseid][hEnterY] = cache_get_row_float(0, 11, dbHandle);
HouseInfo[houseid][hEnterZ] = cache_get_row_float(0, 12, dbHandle);
HouseInfo[houseid][hEnterA] = cache_get_row_float(0, 13, dbHandle);
HouseInfo[houseid][hExitX] = cache_get_row_float(0, 14, dbHandle);
HouseInfo[houseid][hExitY] = cache_get_row_float(0, 15, dbHandle);
HouseInfo[houseid][hExitZ] = cache_get_row_float(0, 16, dbHandle);
HouseInfo[houseid][hExitA] = cache_get_row_float(0, 17, dbHandle);
HouseInfo[houseid][hPickUp] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ], 0);
format(string, sizeof(string), "ID: %d\n"Pink"Address"White": %s\n"Pink"Owner"White": %s\n"Pink"Price"White": $%d", HouseInfo[houseid][hID], HouseInfo[houseid][hAddress], HouseInfo[houseid][hOwner], HouseInfo[houseid][hPrice]);
HouseInfo[houseid][hText] = CreateDynamic3DTextLabel(string, -1, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ], 20.0);
printf("Lol");
houseid++;
}
}
printf("All houses have been successfully loaded.");
return 1;
}
pawn Код:
[19:50:37] [WARNING] cache_get_row_count - no active cache
[19:50:37] [WARNING] cache_get_field_count - no active cache