06.01.2018, 06:59
Hello guys, please help me! I have problem with my hosue loading!
The code (OnGameModeInit):
And here is my callback for laoding:
Output:
(they are three, because I have 3 rows created)
The code (OnGameModeInit):
PHP код:
mysql_format(zMySQL, query, sizeof(query), "SELECT * FROM `houses`");
mysql_query(zMySQL, query);
for(new h = 1; h < cache_num_rows()+1; h++)
{
mysql_format(zMySQL, query, sizeof(query), "SELECT * FROM `houses` WHERE `ID` = %d", h);
mysql_tquery(zMySQL, query, "LoadHouses", "i", h);
if(strcmp(HouseInfo[h][hOwner], "No", true) == 0)
{
HouseInfo[h][hPickup] = CreatePickup(1273, 1, HouseInfo[h][hX], HouseInfo[h][hY], HouseInfo[h][hZ]);
HouseInfo[h][hIcon] = CreateDynamicMapIcon(HouseInfo[h][hX], HouseInfo[h][hY], HouseInfo[h][hZ], 31, 0,0,0);
}
else
{
HouseInfo[h][hPickup] = CreatePickup(19522, 1, HouseInfo[h][hX], HouseInfo[h][hY], HouseInfo[h][hZ]);
HouseInfo[h][hIcon] = CreateDynamicMapIcon(HouseInfo[h][hX], HouseInfo[h][hY], HouseInfo[h][hZ], 32, 0,0,0);
}
}
PHP код:
forward LoadHouses(houseid);
public LoadHouses(houseid)
{
new Float:test;
cache_get_value_name_float(houseid, "X", test);
printf("%f", test);
}
Quote:
0.000000 0.000000 0.000000 |