22.05.2010, 00:58
What are the value ranges for GetVehicleDamageStatus?
panels =
doors =
lights =
tires = 0000 - 1111
panels =

doors =

lights =

tires = 0000 - 1111
Originally Posted by cAMo
What are the value ranges for GetVehicleDamageStatus?
panels = ![]() doors = ![]() lights = ![]() tires = 0000 - 1111 |
new panels,doors,lights,tires; GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); printf("Vehicle Status : [Panels] : %d - [Doors] : %d - [Lights] : %d - [Tires] : %d",panels,doors,lights,tires);
Originally Posted by cAMo
I am storing the vehicle's damage into a MySQL database. I need the ranges to know how big to make the fields.
The wiki, which I have read, doesn't have that info. It should... but it only has it for the tires. Tires = 0 - 1111 (Len: 4) What about the rest? |
Originally Posted by cAMo
Congratulations. Do you want to help me?
|
Originally Posted by Shady91
Quote:
![]() |
Originally Posted by Kyosaur!!
Quote:
lol back on topic, i'd either put 6 or 11 charaacters. 6 is an educated guess, as i highly doubt any value will pass that; The 11 characters is just incase your extremely paranoid, as thats the longest integer you can obtain in pawn (-2147483647). |
stock GetVehiclePanelsDamageStatus(vehicleid, &FrontLeft, &FrontRight, &RearLeft, &RearRight, &WindShield, &FrontBumper, &RearBumper)
{
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
FrontLeft = Panels & 15;
FrontRight = Panels >> 4 & 15;
RearLeft = Panels >> 8 & 15;
RearRight = Panels >> 12 & 15;
WindShield = Panels >> 16 & 15;
FrontBumper = Panels >> 20 & 15;
RearBumper = Panels >> 24 & 15;
return true;
}
stock GetVehicleDoorsDamageStatus(vehicleid, &Bonnet, &Boot, &FrontLeft, &FrontRight, &RearLeft, &RearRight)
{
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
Bonnet = Doors & 7;
Boot = Doors >> 8 & 7;
FrontLeft = Doors >> 16 & 7;
FrontRight = Doors >> 24 & 7;
RearLeft = Doors >> 32 & 7;
RearRight = Doors >> 40 & 7;
return true;
}
stock GetVehicleLightsDamageStatus(vehicleid, &First, &Second, &Third, &Fourth)
{
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
First = Lights & 1;
Second = Lights >> 1 & 1;
Third = Lights >> 2 & 1;
Fourth = Lights >> 3 & 1;
return true;
}
stock GetVehicleTiresDamageStatus(vehicleid, &FrontLeft, &FrontRight, &RearLeft, &RearRight)
{
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
if(GetVehicleType(vehicleid) == MOTORBIKE || GetVehicleType(vehicleid) == BIKE) FrontLeft = Tires >> 1 & 1, FrontRight = Tires & 1;
else
{
RearRight = Tires & 1;
FrontRight = Tires >> 1 & 1;
RearLeft = Tires >> 2 & 1;
FrontLeft = Tires >> 3 & 1;
}
return true;
}
stock UpdateVehiclePanelsDamageStatus(vehicleid, FrontLeft, FrontRight, RearLeft, RearRight, WindShield, FrontBumper, RearBumper)
{
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
return UpdateVehicleDamageStatus(vehicleid, FrontLeft | (FrontRight << 4) | (RearLeft << 8) | (RearRight << 12) | (WindShield << 16) | (FrontBumper << 20) | (RearBumper << 24), Doors, Lights, Tires);
}
stock UpdateVehicleDoorsDamageStatus(vehicleid, Bonnet, Boot, FrontLeft, FrontRight, RearLeft, RearRight)
{
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
return UpdateVehicleDamageStatus(vehicleid, Panels, Bonnet | (Boot << 8) | (FrontLeft << 16) | (FrontRight << 24) | (RearLeft << 32) | (RearRight << 40), Lights, Tires);
}
stock UpdateVehicleLightsDamageStatus(vehicleid, First, Second, Third, Fourth)
{
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
return UpdateVehicleDamageStatus(vehicleid, Panels, Doors, First | (Second << 1) | (Third << 2) | (Fourth << 3), Tires);
}
#define CAR 0
#define BIKE 1
#define MOTORBIKE 2
#define BOAT 3
#define PLANE 4
#define RC 5
#define TRAIN 6
#define TRAILER 7
#define HELICOPTER 8
stock GetVehicleType(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 400 .. 416, 418 .. 424, 426 .. 429, 431 .. 434, 436 .. 440, 442 .. 445, 451, 455 .. 459, 466, 467, 470, 471, 474, 475, 477 .. 480, 482, 483, 485, 486, 489 .. 492, 494 .. 496, 498 .. 500, 502 .. 508, 514 .. 518, 524 .. 536, 539 .. 547, 549 .. 552, 554 .. 562, 565 .. 568, 571 .. 576, 578 .. 580, 582, 583, 585, 587 .. 589, 596 .. 605, 609: return CAR;
case 481, 509, 510: return BIKE;
case 448, 461 .. 463, 468, 521 .. 523, 581, 586: return MOTORBIKE;
case 430, 446, 452 .. 454, 472, 473, 484, 493, 595: return BOAT;
case 460, 476, 511 .. 513, 519, 520, 553, 577, 592, 593: return PLANE;
case 441, 464, 465, 501, 564, 594: return RC;
case 449, 537, 538, 569, 570, 590: return TRAIN;
case 435, 450, 584, 591, 606 .. 608, 610, 611: return TRAILER;
case 417, 425, 447, 469, 487, 488, 497, 548, 563: return HELICOPTER;
}
return -1;
}
stock UpdateVehicleTiresDamageStatus(vehicleid, FrontLeft, FrontRight, RearLeft, RearRight)
{
new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
if(GetVehicleType(vehicleid) == MOTORBIKE || GetVehicleType(vehicleid) == BIKE) return UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, FrontRight | (FrontLeft << 1));
else return UpdateVehicleDamageStatus(vehicleid, Panels, Doors, Lights, RearRight | (FrontRight << 1) | (RearLeft << 2) | (FrontLeft << 3));
}