09.04.2017, 17:29
I tried to make a biz and house system but when ever i create a biz or house the and i restart the gamemode it moves the house to blueberry acre (Bug) not this is my coding for saving the house
Now as you can see its a bit similar to the correct spot but i want to know why its giving me this. I will be online and waiting for replies and ask for any piece of coding i will post it immediately
PHP код:
stock SaveHouses()
{
if(!fexist("ODA/houses.cfg")) fcreate("ODA/houses.cfg");
new idx = 1, File:file;
new string[256];
while(idx < MAX_HOUSES)
{
format(string, sizeof(string), "%d || %d || %d || %s || %f || %f || %f || %d ||\r\n",HouseInfo[idx][hLevel],HouseInfo[idx][hPrice],HouseInfo[idx][hStatus],HouseInfo[idx][hOwner],HouseInfo[idx][hX],HouseInfo[idx][hY],HouseInfo[idx][hZ],HouseInfo[idx][hMoney]);
if(idx == 1)
{
file = fopen("ODA/houses.cfg", io_write);
}
else
{
file = fopen("ODA/houses.cfg", io_append);
}
fwrite(file, string);
fclose(file);
idx++;
}
print("Houses saved successfully.");
}
PHP код:
2347.128662 || -1264.981079 || 27.976562 //This is the bugged coordinates that it gives
//and this is the coordinate i created the biz at
2347.1917,-1265.0759,27.9766 //this is where the biz should be create when i restart the server.