[HELP]Vehicle damage status not saving correctly
#3

Why do you create an array which can hold all vehicle's (2000 of them) while you only save 1 vehicle?

pawn Код:
new VehiclePanels, VehicleDoors, VehicleLights, VehicleTires;

GetVehicleDamageStatus(vehicleid, VehiclePanels, VehicleDoors, VehicleLights, VehicleTires);

printf("Saving vehicle-id: %i", vehicleid);
printf("Panels: %i, Doors: %i, Lights: %i, Tires: %i", VehiclePanels, VehicleDoors, VehicleLights, VehicleTires);

format(line, sizeof(line), "Panels=%d\r\n", VehiclePanels); fwrite(handle, line);
format(line, sizeof(line), "Doors=%d\r\n", VehicleDoors); fwrite(handle, line);
format(line, sizeof(line), "Lights=%d\r\n", VehicleLights); fwrite(handle, line);
format(line, sizeof(line), "Tires=%d\r\n", VehicleTires); fwrite(handle, line);
This would do.

The printf statements I added could be used to debug your variables so that you can check if they are filled with proper data before saving.

Other than this, I see no reason why only the panels are saved.
Reply


Messages In This Thread
[HELP]Vehicle damage status not saving correctly - by WingedFrostWolf - 21.02.2015, 13:15
Re: [HELP]Vehicle damage status not saving correctly - by DarK_FeneR - 19.03.2015, 23:18
Re: [HELP]Vehicle damage status not saving correctly - by PowerPC603 - 20.03.2015, 05:51

Forum Jump:


Users browsing this thread: 3 Guest(s)