07.02.2018, 17:56
What does the following show you in server log:
are the coords correct?
I have had this problem once.
try this:
PHP код:
format(string, sizeof(string), "House %d, x: %d, y:%d, z:%d", id, hInfo[id][hEnterX], hInfo[id][hEnterY], hInfo[id][hEnterZ]);
I have had this problem once.
try this:
PHP код:
forward LoadHouses();
public LoadHouses()
{
new rows;
cache_get_row_count(rows);
new Float:X, Float:Y, Float:Z;
if(rows)
{
new id, loaded;
for(new i = 0; i < rows; i++) {
cache_get_value_name_int(loaded, "ID", id);
cache_get_value_name_float(loaded, "EnterX", hInfo[id][hEnterX]);
cache_get_value_name_float(loaded, "EnterY", hInfo[id][hEnterY]);
cache_get_value_name_float(loaded, "EnterZ", hInfo[id][hEnterZ]);
cache_get_value_name_float(loaded, "ExitX", hInfo[id][hExitX]);
cache_get_value_name_float(loaded, "ExitX", hInfo[id][hExitY]);
cache_get_value_name_float(loaded, "ExitY", hInfo[id][hExitZ]);
cache_get_value_name_float(loaded, "ExitZ", hInfo[id][hExitX]);
cache_get_value_name_int(loaded, "InsideInt", hInfo[id][hInsideInt]);
cache_get_value_name_int(loaded, "InsideVir", hInfo[id][hInsideVir]);
cache_get_value_name_int(loaded, "OutsideInt", hInfo[id][hOutsideInt]);
cache_get_value_name_int(loaded, "Level", hInfo[id][hLevel]);
cache_get_value_name(loaded, "Owner", hInfo[id][hOwner], 48);
cache_get_value_name_int(loaded, "Price", hInfo[id][hPrice]);
X = hInfo[id][hEnterX];
Y = hInfo[id][hEnterY];
Z = hInfo[id][hEnterZ];
new string[255];
format(string, sizeof(string), "House %d, x: %d, y:%d, z:%d", id, hInfo[id][hEnterX], hInfo[id][hEnterY], hInfo[id][hEnterZ]);
print(string);
loaded++;
hInfo[id][hPickup] = CreatePickup(1273, 0, X, Y, Z, -1);
}
new string[255];
format(string, sizeof(string), "Loaded %d houses from Database.", rows);
print(string);
}
else
{
print("No house loaded on Database.");
return 1;
}
return 1;
}