[Help] Loading Houses from a .ini file
#10

I think you can better use files: house1.ini, house2.ini so:
pawn Код:
new file[128];
for(new h = 1; h < sizeof(HouseInfo); h++)
{
   format(file, 128, "LVRP/Properties/Houses/House%d.ini", h);
   if(dini_Exists(file))
   {
        HouseInfo[h][hEntrancex] = dini_Float(file, "Enterance_X");
        HouseInfo[h][hEntrancey] = dini_Float(file, "Enterance_Y");
        HouseInfo[h][hEntrancez] = dini_Float(file, "Enterance_Z");
        HouseInfo[h][hOwned] = dini_Int(file, "Owned");
        HouseInfo[h][hOwner] = dini_Int(file, "Owner");
        HouseInfo[h][hPrice] = dini_Int(file, "Price");
        HouseInfo[h][hExitx] = dini_Float(file, "Exit_X");
        HouseInfo[h][hExity] = dini_Float(file, "Exit_Y");
        HouseInfo[h][hExitz] = dini_Float(file, "Exit_Z");
        HouseInfo[h][hInterior] = dini_Int(file, "Interior");
        HouseInfo[h][hVirtualWorld] = dini_Int(file, "World");
   }
}
And create houses in House1.ini, House2.ini, House3.ini etc.

Edit
House1.ini:
Код:
Enterance_X=1365.420898
Enterance_Y=1974.188232
Enterance_Z=11.460900
OWned=0
Owner=None
Price=200
House2.ini:
Код:
Exit_X=2233.7600
Exit_Y=-1115.2631
Exit_Z=1050.8828
Interior=1
World=1
House3.ini:
Код:
Enterance_X=1364.2799
Enterance_Y=1931.6750
Enterance_Z=11.4683
OWned=0
Owner=None
Price=200
House4.ini:
Код:
Exit_X=2233.7600
Exit_Y=-1115.2631
Exit_Z=1050.8828
Interior=1
World=1
Reply


Messages In This Thread
[Help] Loading Houses from a .ini file - by Maxips2 - 08.07.2010, 12:52
Re: [Help] Loading Houses from a .ini file - by Maxips2 - 08.07.2010, 14:01
Re: [Help] Loading Houses from a .ini file - by CAR - 08.07.2010, 14:05
Re: [Help] Loading Houses from a .ini file - by Maxips2 - 08.07.2010, 14:07
Re: [Help] Loading Houses from a .ini file - by RichyB - 08.07.2010, 14:10
Re: [Help] Loading Houses from a .ini file - by CAR - 08.07.2010, 14:11
Re: [Help] Loading Houses from a .ini file - by Maxips2 - 08.07.2010, 14:14
Re: [Help] Loading Houses from a .ini file - by TouR - 08.07.2010, 14:18
Re: [Help] Loading Houses from a .ini file - by Maxips2 - 08.07.2010, 14:18
Re: [Help] Loading Houses from a .ini file - by CAR - 08.07.2010, 14:22

Forum Jump:


Users browsing this thread: 2 Guest(s)