I select * from houses which is then passed through to the "HouseCheck" function:
pawn Код:
forward HouseCheck();
public HouseCheck()
{
new rows = mysql_num_rows();
if(!rows) return print("Houses failed to load. - No rows returned.");
for(new i = 0; i < rows; i++)
{
new temp[24];
HouseInfo[i][ID] = cache_get_row_int(i, 0, sqldb);
cache_get_row(i, 1, temp); HouseInfo[i][Owner] = temp;
HouseInfo[i][IntX] = cache_get_row_float(i, 2, sqldb);
HouseInfo[i][IntY] = cache_get_row_float(i, 3, sqldb);
HouseInfo[i][IntZ] = cache_get_row_float(i, 4, sqldb);
HouseInfo[i][ExtX] = cache_get_row_float(i, 5, sqldb);
HouseInfo[i][ExtY] = cache_get_row_float(i, 6, sqldb);
HouseInfo[i][ExtZ] = cache_get_row_float(i, 7, sqldb);
HouseInfo[i][Interior] = cache_get_row_int(i, 8, sqldb);
HouseInfo[i][Locked] = cache_get_row_int(i, 9, sqldb);
HouseInfo[i][Money] = cache_get_row_int(i, 10, sqldb);
HouseInfo[i][Price] = cache_get_row_int(i, 11, sqldb);
if(!strcmp("STATE", HouseInfo[i][Owner]))
{
format(GlobalString, sizeof(GlobalString), ""COL_RED"[House]\n"COL_WHITE"Price: %i", HouseInfo[i][Price]);
HouseInfo[i][hLabel] = Create3DTextLabel(GlobalString, 0x008080FF, HouseInfo[i][ExtX], HouseInfo[i][ExtY], HouseInfo[i][ExtZ], 40.0, 0, 0);
HouseInfo[i][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[i][ExtX], HouseInfo[i][ExtY], HouseInfo[i][ExtZ], -1);
}
else
{
format(GlobalString, sizeof(GlobalString), ""COL_RED"[House]\n"COL_WHITE"Owner: %s", HouseInfo[i][Owner]);
HouseInfo[i][hLabel] = Create3DTextLabel(GlobalString, 0x008080FF, HouseInfo[i][ExtX], HouseInfo[i][ExtY], HouseInfo[i][ExtZ], 40.0, 0, 0);
HouseInfo[i][hPickup] = CreateDynamicPickup(1272, 1, HouseInfo[i][ExtX], HouseInfo[i][ExtY], HouseInfo[i][ExtZ], -1);
}
}
return true;
}