i encounterd some problems with file saving.
After each save it writes same data.
pawn Код:
stock SaveHouseData(houseid)
{
new hFile[150];
format(hFile,sizeof(hFile),"Namai/%d.ini", houseid);
new INI:File = INI_Open(hFile);
INI_WriteInt(File,"Created",HouseInfo[houseid][hCreated]);
INI_WriteInt(File,"Owned",HouseInfo[houseid][hOwned]);
INI_WriteString(File,"Owner",HouseInfo[houseid][hOwnerName]);
INI_WriteInt(File,"Locked",HouseInfo[houseid][hLocked]);
INI_WriteFloat(File,"EnterX",HouseInfo[houseid][hEnterX]);
INI_WriteFloat(File,"EnterY",HouseInfo[houseid][hEnterY]);
INI_WriteFloat(File,"EnterZ",HouseInfo[houseid][hEnterZ]);
INI_WriteFloat(File,"ExitX",HouseInfo[houseid][hExitX]);
INI_WriteFloat(File,"ExitY",HouseInfo[houseid][hExitY]);
INI_WriteFloat(File,"ExitZ",HouseInfo[houseid][hExitZ]);
INI_WriteFloat(File,"Garage EnterX",HouseInfo[houseid][hGEnterX]);
INI_WriteFloat(File,"Garage EnterY",HouseInfo[houseid][hGEnterY]);
INI_WriteFloat(File,"Garage EnterZ",HouseInfo[houseid][hGEnterZ]);
INI_WriteFloat(File,"Garage ExitX",HouseInfo[houseid][hGExitX]);
INI_WriteFloat(File,"Garage ExitY",HouseInfo[houseid][hGExitY]);
INI_WriteFloat(File,"Garage ExitZ",HouseInfo[houseid][hGExitZ]);
INI_WriteInt(File,"Garage Occupied",HouseInfo[houseid][hGIsOccupied]);
INI_WriteInt(File,"Garage Locked",HouseInfo[houseid][hGIsLocked]);
INI_WriteInt(File,"Has a Garage",HouseInfo[houseid][hhasAGarage]);
INI_WriteString(File,"Address",HouseInfo[houseid][hAddress]);
INI_WriteString(File,"Description",HouseInfo[houseid][hDescription]);
INI_WriteInt(File,"Interior",HouseInfo[houseid][hInterior]);
INI_WriteInt(File,"VirtualWorld",HouseInfo[houseid][hVirtualWorld]);
INI_WriteInt(File,"Price",HouseInfo[houseid][hPrice]);
INI_WriteInt(File,"IsRentable",HouseInfo[houseid][hIsRentable]);
INI_WriteInt(File,"RentPrice",HouseInfo[houseid][hRentPrice]);
INI_WriteString(File,"Renter",HouseInfo[houseid][hRenter]);
INI_WriteInt(File,"IsRented",HouseInfo[houseid][hIsRented]);
INI_WriteInt(File,"Money",HouseInfo[houseid][hMoney]);
INI_WriteInt(File,"Gun1",HouseInfo[houseid][hGun1]);
INI_WriteInt(File,"Ammo1",HouseInfo[houseid][hAmmo1]);
INI_WriteInt(File,"Gun2",HouseInfo[houseid][hGun2]);
INI_WriteInt(File,"Ammo2",HouseInfo[houseid][hAmmo2]);
INI_WriteInt(File,"Taxes",HouseInfo[houseid][hTaxes]);
INI_Close(File);
return 1;
}
forward LoadHouseData(houseid, name[], value[]);
public LoadHouseData(houseid, name[], value[])
{
INI_Int("Created",HouseInfo[houseid][hCreated]);
INI_Int("Owned",HouseInfo[houseid][hOwned]);
INI_String("Owner",HouseInfo[houseid][hOwnerName],MAX_PLAYER_NAME);
INI_Int("Locked",HouseInfo[houseid][hLocked]);
INI_Float("EnterX",HouseInfo[houseid][hEnterX]);
INI_Float("EnterY",HouseInfo[houseid][hEnterY]);
INI_Float("EnterZ",HouseInfo[houseid][hEnterZ]);
INI_Float("ExitX",HouseInfo[houseid][hExitX]);
INI_Float("ExitY",HouseInfo[houseid][hExitY]);
INI_Float("ExitZ",HouseInfo[houseid][hExitZ]);
INI_Float("Garage EnterX",HouseInfo[houseid][hEnterX]);
INI_Float("Garage EnterY",HouseInfo[houseid][hEnterY]);
INI_Float("Garage EnterZ",HouseInfo[houseid][hEnterZ]);
INI_Float("Garage ExitX",HouseInfo[houseid][hGExitX]);
INI_Float("Garage ExitY",HouseInfo[houseid][hGExitY]);
INI_Float("Garage ExitZ",HouseInfo[houseid][hGExitZ]);
INI_Int("Garage Occupied",HouseInfo[houseid][hGIsOccupied]);
INI_Int("Garage Locked",HouseInfo[houseid][hGIsLocked]);
INI_Int("Has a Garage",HouseInfo[houseid][hhasAGarage]);
INI_String("Address",HouseInfo[houseid][hAddress],32);
INI_String("Description",HouseInfo[houseid][hDescription],32);
INI_Int("Interior",HouseInfo[houseid][hInterior]);
INI_Int("VirtualWorld",HouseInfo[houseid][hVirtualWorld]);
INI_Int("Price",HouseInfo[houseid][hPrice]);
INI_Int("IsRentable",HouseInfo[houseid][hIsRentable]);
INI_Int("RentPrice",HouseInfo[houseid][hRentPrice]);
INI_String("Renter",HouseInfo[houseid][hRenter],MAX_PLAYER_NAME);
INI_Int("IsRented",HouseInfo[houseid][hIsRented]);
INI_Int("Money",HouseInfo[houseid][hMoney]);
INI_Int("Gun1",HouseInfo[houseid][hGun1]);
INI_Int("Ammo1",HouseInfo[houseid][hAmmo1]);
INI_Int("Gun2",HouseInfo[houseid][hGun2]);
INI_Int("Ammo2",HouseInfo[houseid][hAmmo2]);
INI_Int("Taxes",HouseInfo[houseid][hTaxes]);
return 1;
}