sa-mp.exe doesn't finish
#6

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;
}
fclose was out of the: if (file) check; hence it crashed. It should've been inside that check. Also 256 is too much, make it lower. Same for the float's string.
Reply


Messages In This Thread
sa-mp.exe doesn't finish - by Coldfox - 24.12.2013, 10:21
Re: sa-mp.exe doesn't finish - by Konstantinos - 24.12.2013, 10:32
Re: sa-mp.exe doesn't finish - by Coldfox - 24.12.2013, 11:00
Re: sa-mp.exe doesn't finish - by Konstantinos - 24.12.2013, 11:08
Re: sa-mp.exe doesn't finish - by Coldfox - 24.12.2013, 11:20
Re: sa-mp.exe doesn't finish - by Konstantinos - 24.12.2013, 11:22
Re: sa-mp.exe doesn't finish - by Coldfox - 24.12.2013, 11:29
Re: sa-mp.exe doesn't finish - by Konstantinos - 24.12.2013, 11:33
Re: sa-mp.exe doesn't finish - by Tom Kingston - 24.12.2013, 12:02
Re: sa-mp.exe doesn't finish - by Konstantinos - 24.12.2013, 12:09

Forum Jump:


Users browsing this thread: 1 Guest(s)