27.01.2012, 15:00
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?
So I want that it loads the files 1.ini 2.ini 3.ini etc.
Is this possible?
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;
}
Is this possible?