car won't create with fornew.
#1

pawn Код:
for(new i = 1; i < sizeof(CarInfo); i++)
    {
        CarInfo[i][ownedvehicle] = CreateVehicle(CarInfo[i][vModel],CarInfo[i][vLocationx],CarInfo[i][vLocationy],CarInfo[i][vLocationz],CarInfo[i][vAngle],CarInfo[i][vColorOne],CarInfo[i][vColorTwo],300000);
    }
It gets the info from here:
pawn Код:
public LoadCar()
{
    new arrCoords[13][64];
    new strFromFile2[256];
    new File: file = fopen("CarOwnership.cfg", io_read);
    if (file)
    {
        new idx = 0;
        while (idx < sizeof(CarInfo))
        {
            fread(file, strFromFile2);
            split(strFromFile2, arrCoords, ',');
            CarInfo[idx][vModel] = strval(arrCoords[0]);
            CarInfo[idx][vLocationx] = floatstr(arrCoords[1]);
            CarInfo[idx][vLocationy] = floatstr(arrCoords[2]);
            CarInfo[idx][vLocationz] = floatstr(arrCoords[3]);
            CarInfo[idx][vAngle] = floatstr(arrCoords[4]);
            CarInfo[idx][vColorOne] = strval(arrCoords[5]);
            CarInfo[idx][vColorTwo] = strval(arrCoords[6]);
            strmid(CarInfo[idx][vOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
            strmid(CarInfo[idx][vDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
            CarInfo[idx][vValue] = strval(arrCoords[9]);
            CarInfo[idx][vLicense] = strval(arrCoords[10]);
            CarInfo[idx][vOwned] = strval(arrCoords[11]);
            CarInfo[idx][vLock] = strval(arrCoords[12]);
            printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][vOwner],CarInfo[idx][vLicense]);
            idx++;
        }
    }
    return 1;
}
And the LoadCar(); is put one line before the fornew createvehicle. Here's one example from the file read:
Код:
560,559.598815,-1267.766967,17.242200,90.000000,0,0,Louis,,20000,,1,0
Please help
Reply


Messages In This Thread
car won't create with fornew. - by Jack_Leslie - 12.08.2011, 09:16

Forum Jump:


Users browsing this thread: 1 Guest(s)