Housing Script
#1

Is there an easier way to make a housing script that having one INI file that for instance the following
Код:
house1_name = Beach Hideout
house1_owner = Owner_Name
house1_price = 90000
house1_interior = 3
house2_name = Lake House
house2_owner = Owner_Name
house2_price = 100000
house2_interior = 5
So on and so forth for each and every house? Because then I would have to have 4 lines of code for each possible house number.
pawn Код:
INI_WriteString(myFile, "house1_name", hInfo[1][Name]);
INI_WriteString(myFile, "house1_owner", hInfo[1][Owner]);
INI_WriteInt(myFile, "house1_price", hInfo[1][Price]);
INI_WriteInt(myFile, "house1_interior", hInfo[1][Interior]);
INI_WriteString(myFile, "house2_name", hInfo[2][Name]);
INI_WriteString(myFile, "house2_owner", hInfo[2][Owner]);
INI_WriteInt(myFile, "house2_price", hInfo[2][Price]);
INI_WriteInt(myFile, "house2_interior", hInfo[2][Interior]);
That is just with 2 houses, imagine 20 of them.

Is there a way to have just a folder called "houses" in the scriptfiles folder that, each time a new house is generated, it makes a new text document titled 1.ini, 2.ini, 3.ini so forth, and then scan that folder OnGamemodeInit() for all those and import them? Or do I just have to stick with the way I was doing it above. Also, if you have any other ways or ideas, let me know. Thanks.
Reply


Messages In This Thread
Housing Script - by Nathan_Taylor - 03.05.2014, 03:14
Re: Housing Script - by Dignity - 03.05.2014, 03:19
Re: Housing Script - by Nathan_Taylor - 03.05.2014, 03:21
Re: Housing Script - by Dignity - 03.05.2014, 03:24
Re: Housing Script - by Nathan_Taylor - 03.05.2014, 03:27
Re: Housing Script - by Dignity - 03.05.2014, 03:29

Forum Jump:


Users browsing this thread: 1 Guest(s)