08.08.2009, 17:27
I don't know how long i've been trying this, my final way to do this is to look at another scripts and attempt to make my own in a similar way.
Bascially, It reads from a file: scriptfiles/houses/house.cfg and creates pickups there:
The way I've created it to being in the house.cfg file is:
OwnerName, HouseCost, HouseId, HouseInterior, HouseXPos, HouseYPos, HouseZPos
Here is what I have in it:
Here is the code I am trying to get to load that:
Yes, if you are wondering I got the idea of the layout from The GodFather Script, It was a last resort as is asking you this! why is it not loading?
Bascially, It reads from a file: scriptfiles/houses/house.cfg and creates pickups there:
The way I've created it to being in the house.cfg file is:
OwnerName, HouseCost, HouseId, HouseInterior, HouseXPos, HouseYPos, HouseZPos
Here is what I have in it:
Код:
None, 1000, 1, 4, -987908085, -1004970794, 1124372480
Код:
forward LoadHouse();
Код:
public LoadHouses()
{
new arrCoords[29][64];
new strFromFile2[256];
new File: file = fopen("houses/house.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(HouseInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
strmid(HouseInfo[idx][hHouseOwnerName], arrCoords[13], 0, strlen(arrCoords[13]), 255);
HouseInfo[idx][hHouseCost] = strval(arrCoords[14]);
HouseInfo[idx][hHouseId] = strval(arrCoords[14]);
HouseInfo[idx][hHouseInterior] = strval(arrCoords[14]);
HouseInfo[idx][hHousex] = floatstr(arrCoords[0]);
HouseInfo[idx][hHousey] = floatstr(arrCoords[1]);
HouseInfo[idx][hHousez] = floatstr(arrCoords[2]);
CreatePickup(1273, 1, HouseInfo[idx][hHousex], HouseInfo[idx][hHousey], HouseInfo[idx][hHousez]);
idx++;
}
fclose(file);
}
return 1;
}

