06.09.2010, 18:31
Substitui sua public LoadCars por essa:
pawn Код:
public LoadCar()
{
new arrCoords[14][64];
new strFromFile2[256];
new File: file = fopen("Carros.cfg", io_read);
if (file)
{
new idx = 1;
while (idx < sizeof(CarInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
CarInfo[idx][cModel] = strval(arrCoords[0]);
CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
CarInfo[idx][cColorOne] = strval(arrCoords[5]);
CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
CarInfo[idx][cValue] = strval(arrCoords[9]);
CarInfo[idx][cLicense] = strval(arrCoords[10]);
CarInfo[idx][cOwned] = strval(arrCoords[11]);
CarInfo[idx][cLock] = strval(arrCoords[12]);
CarInfo[idx][cGrana] = strval(arrCoords[13]);
CarInfo[idx][cID] = totalveiculosc+idx;
printf("Carro: %d Dono:%s[%d] LicensePlate %s ID[%d]",idx,CarInfo[idx][cOwner],CarInfo[idx][cOwned],CarInfo[idx][cLicense],CarInfo[idx][cID]);
CreateVehicle(CarInfo[idx][cModel], CarInfo[idx][Locationx], CarInfo[idx][Locationy], CarInfo[idx][Locationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo], -1);
idx++;
}
}
return 1;
}