PDA

View Full Version : Binary/Bits stuff for tire popping


MP2
25/01/2013, 08:24 PM
This is something I really need to learn..

This code makes the back two tires pop:


GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, 1 | (0 << 1) | (1 << 2) | (0 << 3));

But the problem is, it makes the front two NOT popped - repairing them if they are already popped. How do I make it so it keeps any others popped?

http://wiki.sa-mp.com/wiki/TireStates

Vince
25/01/2013, 08:29 PM
UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, (Tires | 0b0101));

That should work.

MP2
25/01/2013, 08:41 PM
Aha! Thanks!