22.06.2017, 21:24
(
Последний раз редактировалось GoldenLion; 23.06.2017 в 16:03.
)
Hi, I need to make the driver door of a vehicle damaged. I know I'll first need to use GetVehicleDamageStatus to get that doors set of bits then I need to somehow change that driver door byte to 010 according to wiki, but I'm totally lost here because I don't know how to work with bits or bytes because I never had to. I'll appreciate that if someone helped me with this. I don't even know how to properly explain that, but basically what I want to do is set the damage state of the driver door to damaged and closed.
EDIT: I literally found this after posting this.
EDIT 2:
Couldn't get it working, here's the code:
2 is supposed to be that damaged and closed state. What's wrong?
EDIT 3: Fixed. I put driver_door and passenger_door instead of lights and tires for the last 2 parameters, had to be like this:
EDIT: I literally found this after posting this.
EDIT 2:
Couldn't get it working, here's the code:
Код:
new panels, doors, lights, tires, bonnet, boot, driver_door, passenger_door; GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); bonnet = doors & 7; boot = doors >> 8 & 7; driver_door = 2; passenger_door = doors >> 24 & 7; UpdateVehicleDamageStatus(vehicleid, panels, bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24), driver_door, passenger_door);
EDIT 3: Fixed. I put driver_door and passenger_door instead of lights and tires for the last 2 parameters, had to be like this:
Код:
UpdateVehicleDamageStatus(vehicleid, panels, bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24), lights, tires);