05.01.2018, 13:12
PHP код:
// whereever you load your houses
mysql_tquery(zMySQL, "SELECT * FROM `houses`", "LoadHouses");
forward LoadHouses();
public LoadHouses()
{
for(new i=0; i<cache_num_rows(); i++)
{
cache_get_value_name(i, "Owner", HouseInfo[i][hOwner]);
cache_get_value_name_float(i, "X", HouseInfo[i][hX]);
cache_get_value_name_float(i, "Y", HouseInfo[i][hY]);
cache_get_value_name_float(i, "Z", HouseInfo[i][hZ]);
cache_get_value_name_float(i, "Int:X", HouseInfo[i][hiX]);
cache_get_value_name_float(i, "Int:Y", HouseInfo[i][hiY]);
cache_get_value_name_float(i, "Int:Z", HouseInfo[i][hiZ]);
cache_get_value_name_float(i, "X2", HouseInfo[i][hX2]);
cache_get_value_name_float(i, "Y2", HouseInfo[i][hY2]);
cache_get_value_name_float(i, "Z2", HouseInfo[i][hZ2]);
cache_get_value_name_float(i, "A2", HouseInfo[i][hA2]);
cache_get_value_name_float(i, "Int:X2", HouseInfo[i][hiX2]);
cache_get_value_name_float(i, "Int:Y2", HouseInfo[i][hiY2]);
cache_get_value_name_float(i, "Int:Z2", HouseInfo[i][hiZ2]);
cache_get_value_name_float(i, "Int:A2", HouseInfo[i][hiA2]);
cache_get_value_name_float(i, "Spawn:X", HouseInfo[i][hsX]);
cache_get_value_name_float(i, "Spawn:Y", HouseInfo[i][hsY]);
cache_get_value_name_float(i, "Spawn:Z", HouseInfo[i][hsZ]);
cache_get_value_name_float(i, "Spawn:A", HouseInfo[i][hsA]);
cache_get_value_name_int(i, "Interior", HouseInfo[i][hInt]);
cache_get_value_name_int(i, "World", HouseInfo[i][hVW]);
cache_get_value_name_int(i, "Price", HouseInfo[i][hPrice]);
cache_get_value_name_int(i, "Status", HouseInfo[i][hStatus]);
if( strcmp(HouseInfo[i][hOwner], "No", true) == 0 )
{
HouseInfo[i][hPickup] = CreatePickup(1273, 1, HouseInfo[i][hX], HouseInfo[i][hY], HouseInfo[i][hZ]);
HouseInfo[i][hIcon] = CreateDynamicMapIcon(HouseInfo[i][hX], HouseInfo[i][hY], HouseInfo[i][hZ], 31, 0,0,0);
}
else
{
HouseInfo[i][hPickup] = CreatePickup(19522, 1, HouseInfo[i][hX], HouseInfo[i][hY], HouseInfo[i][hZ]);
HouseInfo[i][hIcon] = CreateDynamicMapIcon(HouseInfo[i][hX], HouseInfo[i][hY], HouseInfo[i][hZ], 32, 0,0,0);
}
}
return 1;
}