26.07.2012, 13:06
SaveHouses(houseid)
{
new path[256];
format(path, 35, HOUSES_FILE, houseid);
if(INI_Exists(path) == 0)
{
houseid++;
format(path, 68, "Houses/%i.ini", houseid);
new INI:HouseFile = INI_Open(path);
INI_WriteString(HouseFile,"Owner", HouseInfo[houseid][hOwner]);
INI_WriteString(HouseFile,"Description", HouseInfo[houseid][hDes]);
INI_WriteInt(HouseFile,"Price", HouseInfo[houseid][hPrice]);
INI_WriteInt(HouseFile,"Rent", HouseInfo[houseid][hRent]);
INI_WriteInt(HouseFile,"World", HouseInfo[houseid][hWorld]);
INI_WriteInt(HouseFile,"Interior", HouseInfo[houseid][hInterior]);
INI_WriteFloat(HouseFile,"X", HouseInfo[houseid][hX]);
INI_WriteFloat(HouseFile,"Y", HouseInfo[houseid][hY]);
INI_WriteFloat(HouseFile,"Z", HouseInfo[houseid][hZ]);
INI_WriteFloat(HouseFile,"A", HouseInfo[houseid][hA]);
INI_Close(HouseFile);
return 1;
}
new INI:HouseFile = INI_Open(path);
INI_WriteString(HouseFile,"Owner", HouseInfo[houseid][hOwner]);
INI_WriteString(HouseFile,"Description", HouseInfo[houseid][hDes]);
INI_WriteInt(HouseFile,"Price", HouseInfo[houseid][hPrice]);
INI_WriteInt(HouseFile,"Rent", HouseInfo[houseid][hRent]);
INI_WriteInt(HouseFile,"World", HouseInfo[houseid][hWorld]);
INI_WriteInt(HouseFile,"Interior", HouseInfo[houseid][hInterior]);
INI_WriteFloat(HouseFile,"X", HouseInfo[houseid][hX]);
INI_WriteFloat(HouseFile,"Y", HouseInfo[houseid][hY]);
INI_WriteFloat(HouseFile,"Z", HouseInfo[houseid][hZ]);
INI_WriteFloat(HouseFile,"A", HouseInfo[houseid][hA]);
INI_Close(HouseFile);
print("Houses saved");
return 1;
}
{
new path[256];
format(path, 35, HOUSES_FILE, houseid);
if(INI_Exists(path) == 0)
{
houseid++;
format(path, 68, "Houses/%i.ini", houseid);
new INI:HouseFile = INI_Open(path);
INI_WriteString(HouseFile,"Owner", HouseInfo[houseid][hOwner]);
INI_WriteString(HouseFile,"Description", HouseInfo[houseid][hDes]);
INI_WriteInt(HouseFile,"Price", HouseInfo[houseid][hPrice]);
INI_WriteInt(HouseFile,"Rent", HouseInfo[houseid][hRent]);
INI_WriteInt(HouseFile,"World", HouseInfo[houseid][hWorld]);
INI_WriteInt(HouseFile,"Interior", HouseInfo[houseid][hInterior]);
INI_WriteFloat(HouseFile,"X", HouseInfo[houseid][hX]);
INI_WriteFloat(HouseFile,"Y", HouseInfo[houseid][hY]);
INI_WriteFloat(HouseFile,"Z", HouseInfo[houseid][hZ]);
INI_WriteFloat(HouseFile,"A", HouseInfo[houseid][hA]);
INI_Close(HouseFile);
return 1;
}
new INI:HouseFile = INI_Open(path);
INI_WriteString(HouseFile,"Owner", HouseInfo[houseid][hOwner]);
INI_WriteString(HouseFile,"Description", HouseInfo[houseid][hDes]);
INI_WriteInt(HouseFile,"Price", HouseInfo[houseid][hPrice]);
INI_WriteInt(HouseFile,"Rent", HouseInfo[houseid][hRent]);
INI_WriteInt(HouseFile,"World", HouseInfo[houseid][hWorld]);
INI_WriteInt(HouseFile,"Interior", HouseInfo[houseid][hInterior]);
INI_WriteFloat(HouseFile,"X", HouseInfo[houseid][hX]);
INI_WriteFloat(HouseFile,"Y", HouseInfo[houseid][hY]);
INI_WriteFloat(HouseFile,"Z", HouseInfo[houseid][hZ]);
INI_WriteFloat(HouseFile,"A", HouseInfo[houseid][hA]);
INI_Close(HouseFile);
print("Houses saved");
return 1;
}