SA-MP Forums Archive
Loading the next file. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Loading the next file. (/showthread.php?tid=313797)



Loading the next file. - milanosie - 27.01.2012

I finally am nearly done with my dealership, now the question is.
Since I added locks it only loads one car at a restart. How do I make this more?

pawn Code:
forward LoadCars();
public LoadCars()
{
    for(new i = 1; i < MAX_VEHICLES; i++)
    {
    format(file4,sizeof(file4), "realityrp/vehicles/%d.ini", i);
    if(fexist(file4))
    {
        CarInfo[i][model] = dini_Int(file4, "model");
        CarInfo[i][owner] = dini_Int(file4, "owner");
        CarInfo[i][forsale] = dini_Int(file4, "forsale");
        CarInfo[i][vehx] = dini_Int(file4, "vehx");
        CarInfo[i][vehy] = dini_Int(file4, "vehy");
        CarInfo[i][vehz] = dini_Int(file4, "vehz");
        CarInfo[i][rot] = dini_Int(file4, "rot");
        CarInfo[i][vcol1] = dini_Int(file4, "vcol1");
        CarInfo[i][vcol2] = dini_Int(file4, "vcol2");
        new modv = dini_Int(file4, "model");
        new flx = dini_Int(file4, "vehx");
        new fly = dini_Int(file4, "vehy");
        new flz = dini_Int(file4, "vehz");
        new flr = dini_Int(file4, "rot");
        new fc1 = dini_Int(file4, "vcol1");
        new fc2 = dini_Int(file4, "vcol2");
        CarID = CreateVehicle(modv, flx, fly, flz, flr, fc1, fc2, 6000000);
        vehown[CarID] = CarInfo[i][owner];
        ispr[CarID] = 1;
        return 1;
        }
    }
    return 1;
}
So I want that it loads the files 1.ini 2.ini 3.ini etc.

Is this possible?


Re: Loading the next file. - milanosie - 27.01.2012

anybody?


Re: Loading the next file. - AndreT - 27.01.2012

You have a return 1; in your loop. This stops processing all the code!


Re: Loading the next file. - milanosie - 27.01.2012

thanks