Loading the next file.
#1

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?
Reply
#2

anybody?
Reply
#3

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

thanks
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)