pawn Код:
public LoadCarSystem()
{
new string[128];
for(new i = 1; i < MAX_DVEHICLES; i++)
{
format(string,sizeof(string),"Vehicles/%i.ini",i);
if(dini_Exists(string))
{
CarSystem[i][cModel] = dini_Int(string, "Model");
CarSystem[i][cX] = dini_Float(string, "X");
CarSystem[i][cY] = dini_Float(string, "Y");
CarSystem[i][cZ] = dini_Float(string, "Z");
CarSystem[i][cAngle] = dini_Float(string, "Angle");
CarSystem[i][cColor1] = dini_Int(string, "Color1");
CarSystem[i][cColor2] = dini_Int(string, "Color2");
CarSystem[i][cDelay] = dini_Int(string, "Delay");
CarSystem[i][cObjective] = dini_Int(string, "Objective");
CarSystem[i][cDoorsLocked] = dini_Int(string, "DoorsLocked");
CarSystem[i][cVehicleOwner] = dini_Get(string, "VehicleOwner");
CarSystem[i][cVehicleMaterials] = dini_Int(string, "VehicleMaterials");
CarSystem[i][cVehicleCrack] = dini_Int(string, "VehicleCrack");
CarSystem[i][cVehiclePot] = dini_Int(string, "VehiclePot");
CarSystem[i][cLoad] = dini_Int(string, "VehicleLoad");
CarSystem[i][cCapasity] = dini_Int(string, "VehicleCapasity");
CarSystem[i][cVehicleHealth] = dini_Float(string, "VehicleHealth");
CarSystem[i][cVehicleAlarm] = dini_Int(string, "VehicleAlarm");
CarSystem[i][cVehicleOwned] = dini_Int(string, "VehicleOwned");
CarSystem[i][cNitro] = dini_Int(string, "Nitro");
CarSystem[i][cPaintJob] = dini_Int(string, "PaintJob");
CarSystem[i][cHydro] = dini_Int(string, "Hydro");
CarSystem[i][cPimped] = dini_Int(string, "Pimped");
CarSystem[i][cPerma] = dini_Int(string, "Perma");
CarSystem[i][cRank] = dini_Int(string, "Rank");
CarSystem[i][cPrice] = dini_Int(string, "Price");
CarSystem[i][cFileID] = i;
CarSystem[i][cVehicleID] = AddStaticVehicleEx(CarSystem[i][cModel],CarSystem[i][cX],CarSystem[i][cY],CarSystem[i][cZ],CarSystem[i][cAngle],CarSystem[i][cColor1],CarSystem[i][cColor2], CarSystem[i][cDelay]);
SetVehicleHealth(CarSystem[i][cVehicleID],CarSystem[i][cVehicleHealth]);
//ChangeVehicleColor(CarSystem[i][cVehicleID], CarSystem[i][cColor1], CarSystem[i][cColor2]);
//ChangeVehiclePaintjob(CarSystem[i][cVehicleID], CarSystem[i][cPaintJob]);
CarCount ++;
if(CarSystem[i][cPimped] == 1)
{
if(CarSystem[i][cModel] == 560)
{
AddVehicleComponent(i, 1026);
AddVehicleComponent(i, 1027);
AddVehicleComponent(i, 1028);
AddVehicleComponent(i, 1026);
AddVehicleComponent(i, 1032);
AddVehicleComponent(i, 1041);
}
if(CarSystem[i][cModel] == 562)
{
AddVehicleComponent(i, 1034);
AddVehicleComponent(i, 1036);
AddVehicleComponent(i, 1038);
AddVehicleComponent(i, 1040);
}
}
if(CarSystem[i][cNitro] == 1)
{
AddVehicleComponent(i, 1010);
}
if(CarSystem[i][cHydro] == 1)
{
AddVehicleComponent(i, 1087);
}
}
}
return true;
}