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
#2

Bumping this.
Reply
#3

I still don't get what you are trying to do.
Reply
#4

It shows it right on the wiki dude...

Код:
enum Door
{
	DOOR_HOOD,
	DOOR_TRUNK,
	DOOR_DRIVER
	DOOR_PASSENGER
}
 
enum DoorState(<<= 1)
{
	IS_OPENED = 1,
	IS_DAMAGED,
	IS_REMOVED
}
 
stock GetDoorState(doorStates, Door:door, DoorState:doorState)
	return (doorStates >>> (8 * door)) & doorState;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)