Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
That converts 4 tire states in to the binary number, I need the opposite.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
No, not JUST the back ones.
I have a feeling it will be something like
if(tires & 1 && tires & 3) // Back tires are popped
EDIT: Just tested, that doesn't work :/
Posts: 2,938
Threads: 162
Joined: May 2010
Ah okay, this is simple. I've done it. Well not with tyres but with panels.
wait are you sure that code pops back and not front tyres? from logic it seems 1010 would pop back front and 0101 would pop back tyres
pawn Код:
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
if(tires & 0101)//or in this weird case.. if(tires & 1010)
{
//back tyres are poped
}
//or it might be done by index which it seems like on the wiki
if(tires == 5) //or in this weird case.. if(tires == 10)
{
//back tyres are poped
}
also note you can't do tires & 3 with a bitwise operator, 3 is no a bit
I'm sorry for not using American English for tyres / tires.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Binary values need to be prefixed with 0b (like 0x for hex) otherwise the compiler will just read it as decimal.
Edit: Meh, too late.