TireStates
From SA-MP Wiki
To be used with UpdateVehicleDamageStatus and GetVehicleDamageStatus.
Each value will affect certain tires.
| Note: Even vehicles with more than 4 wheels (e.g. trucks) only have 4 tire values. The back two wheels are 'one'. |
Here is a visual representation of the tire states. Vehicle viewed from a top-down perspective, the top is the front.
Scroll down for bikes.
o = inflated tire
i = popped tire
4-wheeled vehicles
4 binary bits for 4-wheeled vehicles: (FL)(BL)(FR)(BR) (Front-Left, Back-Left, Front-Right and Back-Right)
0: (0000)
o-o
| |
o-o
1: (0001)
o-o
| |
o-i
2: (0010)
o-i
| |
o-o
3: (0011)
o-i
| |
o-i
4: (0100)
o-o
| |
i-o
5: (0101)
o-o
| |
i-i
6: (0110)
o-i
| |
i-o
7: (0111)
o-i
| |
i-i
8: (1000)
i-o
| |
o-o
9: (1001)
i-o
| |
o-i
10: (1010)
i-i
| |
o-o
11: (1011)
i-i
| |
o-i
12: (1100)
i-o
| |
i-o
13: (1101)
i-o
| |
i-i
14: (1110)
i-i
| |
i-o
15: (1111)
i-i
| |
i-i
After 15 the values are repeated, so 16 is 0, 17 is 1 and so on.
2-wheeled vehicles (bikes)
Bike viewed from a top-down perspective, the top is the front.
2 binary bits for 2-wheeled vehicles: (F)(B) (Front and Back)
0: (00)
o
|
o
1: (01)
o
|
i
2: (10)
i
|
o
3: (11)
i
|
i
After 3 the values are repeated, so 4 is 0, 5 is 1 and so on.
Example
To pop the back two tires of a vehicle (with 4 wheels) while keeping the front the same state:
new Panels, Doors, Lights, Tires; GetVehicleDamageStatus(vehicleid), Panels, Doors, Lights, Tires); UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, (Tires | 0b0101));
