Saving Tyre States - How does this work?
#1

pawn Code:
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, (Tires | 0b0101));
This is the example given.

Take for instance, that I wanted to 'slash' a tyre in game.

It would have to check the state of the tyres first, so as to not 'repair' a tyre when bursting another.

So how would I keep the other tyres the same if for instance I chose to burst the back left tyre?

Thanks.
Reply
#2

Here dude
https://sampwiki.blast.hk/wiki/TireStates
Reply
#3

I checked that but its hard to understand
Reply
#4

Code:
UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, 1); // back right
UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, 2); // front right
UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, 4); // back left
UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, 8); // front left
Easy?
Reply
#5

The above will repair the rest of the tires something Dokins doesn't want to. You can use something like this:
pawn Code:
enum Tire_States
{
    NONE,
    BR,
    FR,
    FR_BR,
    BL,
    BL_BR,
    FR_BL,
    FR_BL_BR,
    FL,
    FL_BR,
    FL_FR,
    FL_FR_BR,
    FL_BL,
    FL_BL_BR,
    FL_FR_BL,
    ALL
};
F=Front,B=Back,L=Left,R=Right, ALL and combination of the previous for popped tires and NONE for inflated tires.

and then do:
pawn Code:
(Tires | _:BL)
That will keep the same the other tires and pop back left.
Reply
#6

Ahhh! I see how that works now. I understand.

Thanks a lot Konstantinos, I appreciate it a lot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)