07.05.2014, 11:52
pawn Code:
#define HousePath "AAdmin/Houses/%s.ini"
//------enum---//
stock HPath(Houseid[])
{
new str[128];
for(new d,len = strlen(Houseid); d != len; d++)
Houseid[d] = tolower(Houseid[d]);
format(str,sizeof(str),HousePath,Houseid);
return str;
}
stock LoadProperty(Houseid)
{
INI_ParseFile(HPath(Houseid)),"LoadProperty_%d", .bExtra = true, .extra = Houseid);
return 1;
}
forward loadproperty_Data(Houseid, name[], value[]);
public loadproperty_Data(Houseid, name[], value[])
{
INI_String("OwnerName",HouseData[Houseid][h_OwnerName]);
INI_Int("OwnerID",HouseData[Houseid][h_OwnerID]);
INI_String("RenterName",HouseData[Houseid][h_RenterName]);
INI_Int("RenterID",HouseData[Houseid][h_RenterID]);
INI_String("HouseName",HouseData[Houseid][h_HouseIntName]);
INI_Int("Value",HouseData[Houseid][h_Value]);
INI_Int("Rent",HouseData[Houseid][h_Rent]);
INI_Int("ForSale",HouseData[Houseid][h_ForSale]);
INI_Int("Alarm",HouseData[Houseid][h_Alarm]);
INI_Int("Lock",HouseData[Houseid][h_Lock]);
INI_Int("Money",HouseData[Houseid][h_Money]);
INI_Int("Drugs",HouseData[Houseid][h_Drugs]);
INI_Int("Condoms",HouseData[Houseid][h_Condoms]);
INI_Int("Flowers",HouseData[Houseid][h_Flowers]);
INI_Int("Robberies",HouseData[Houseid][h_Robberies]);
INI_Int("Breakins",HouseData[Houseid][h_Breakins]);
INI_Int("OwnerVisits",HouseData[Houseid][h_OwnerVisits]);
INI_Int("OtherVisits",HouseData[Houseid][h_OtherVisits]);
INI_Int("Purchasers",HouseData[Houseid][h_Purchasers]);
INI_Int("Rented",HouseData[Houseid][h_Rented]);
return 1;
}