24.12.2013, 11:22
pawn Код:
public LoadfCars()
{
new arrCoords[9][20];
new strFromFile2[128];
new File: file = fopen("/settings/factioncars.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(FactionCar))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
FactionCar[idx][fcMod] = strval(arrCoords[0]);
FactionCar[idx][fcParkx] = floatstr(arrCoords[1]);
FactionCar[idx][fcParky] = floatstr(arrCoords[2]);
FactionCar[idx][fcParkz] = floatstr(arrCoords[3]);
FactionCar[idx][fcParkr] = floatstr(arrCoords[4]);
FactionCar[idx][fcCol1] = strval(arrCoords[5]);
FactionCar[idx][fcCol2] = strval(arrCoords[6]);
FactionCar[idx][fcFaction] = strval(arrCoords[7]);
FactionCar[idx][fcEngine] = strval(arrCoords[8]);
idx++;
}
fclose(file);
}
return 1;
}