Код:
for (new CarSlot; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
{
// If a valid vehicle-id has been found
if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
{
// Get the vehicle id
vid = AHouseData[HouseID][VehicleIDs][CarSlot];
format(LineForFile, 100, "[Vehicle]\r\n"); // Construct the line: "[Vehicle]"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleModel %i\r\n", AVehicleData[vid][Model]); // Construct the line: "VehicleModel <VehicleModel>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehiclePaintJob %i\r\n", AVehicleData[vid][PaintJob]); // Construct the line: "VehiclePaintJob <VehiclePaintJob>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleSpoiler %i\r\n", AVehicleData[vid][Components][0]); // Construct the line: "VehicleSpoiler <VehicleSpoiler>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleHood %i\r\n", AVehicleData[vid][Components][1]); // Construct the line: "VehicleHood <VehicleHood>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleRoof %i\r\n", AVehicleData[vid][Components][2]); // Construct the line: "VehicleRoof <VehicleRoof>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleSideSkirt %i\r\n", AVehicleData[vid][Components][3]); // Construct the line: "VehicleSideSkirt <VehicleSideSkirt>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleLamps %i\r\n", AVehicleData[vid][Components][4]); // Construct the line: "VehicleLamps <VehicleLamps>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleNitro %i\r\n", AVehicleData[vid][Components][5]); // Construct the line: "VehicleNitro <VehicleNitro>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleExhaust %i\r\n", AVehicleData[vid][Components][6]); // Construct the line: "VehicleSpoiler <VehicleSpoiler>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleWheels %i\r\n", AVehicleData[vid][Components][7]); // Construct the line: "VehicleWheels <VehicleWheels>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleStereo %i\r\n", AVehicleData[vid][Components][8]); // Construct the line: "VehicleStereo <VehicleStereo>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleHydraulics %i\r\n", AVehicleData[vid][Components][9]); // Construct the line: "VehicleHydraulics <VehicleHydraulics>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleFrontBumper %i\r\n", AVehicleData[vid][Components][10]); // Construct the line: "VehicleFrontBumper <VehicleFrontBumper>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleRearBumper %i\r\n", AVehicleData[vid][Components][11]); // Construct the line: "VehicleRearBumper <VehicleRearBumper>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleVentRight %i\r\n", AVehicleData[vid][Components][12]); // Construct the line: "VehicleVentRight <VehicleVentRight>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleVentLeft %i\r\n", AVehicleData[vid][Components][13]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "Color1 %i\r\n", AVehicleData[vid][Color1]); // Construct the line: "Color1 <Color1>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "Color2 %i\r\n", AVehicleData[vid][Color2]); // Construct the line: "Color2 <Color2>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleX %f\r\n", AVehicleData[vid][SpawnX]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleY %f\r\n", AVehicleData[vid][SpawnY]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleZ %f\r\n", AVehicleData[vid][SpawnZ]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "VehicleAngle %f\r\n", AVehicleData[vid][SpawnRot]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "Fuel %i\r\n", INT_GetVehicleFuel(vid)); // Construct the line: "Fuel <Fuel>"
fwrite(HFile, LineForFile); // And save it to the file
format(LineForFile, 100, "[/Vehicle]\r\n"); // Construct the line: "[/Vehicle]"
fwrite(HFile, LineForFile); // And save it to the file
fwrite(HFile, "\r\n"); // Add an empty line, just for readability
}
}
fclose(HFile); // Close the file
return 1;
}
Line 2564 is? you set INVALID_VEHICLE_ID to array with MAX_VEHICLES here AVehicleData