driver door damage
#1

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:
Код:
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);
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:
Код:
UpdateVehicleDamageStatus(vehicleid, panels, bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24), lights, tires);
Reply


Messages In This Thread
driver door damage - by GoldenLion - 22.06.2017, 21:24
Re: driver door damage - by GoldenLion - 23.06.2017, 15:53
Re: driver door damage - by Dayrion - 24.06.2017, 03:24
Re: driver door damage - by Pottus - 24.06.2017, 03:29

Forum Jump:


Users browsing this thread: 3 Guest(s)