Repairing just a part of a vehicle? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Repairing just a part of a vehicle? (
/showthread.php?tid=465761)
Repairing just a part of a vehicle? -
jakejohnsonusa - 23.09.2013
How would I repair:
Just the lights (All lights)?
Just the panals (All panals)?
Just the doors (All doors)?
Just the tires (All tires)?
I assume I will need UpdateVehicleDamageStatus, but I'm not sure what the value's are for a full repair of each of these things.
This will be used in my server for players to pay for certain repairs they want....
Thanks in advance!
Re: Repairing just a part of a vehicle? -
DobbysGamertag - 23.09.2013
It tells you this on the wiki
Re: Repairing just a part of a vehicle? -
jakejohnsonusa - 23.09.2013
Actually it only mentions the tire and lights. However, in a test I found that a value of 0 will do the trick!
Re: Repairing just a part of a vehicle? -
CesarLT - 23.09.2013
I am not too sure that it's even possible..
Because it all depends on how demaged the vehicle is, and every part is broken at another value..
AW: Repairing just a part of a vehicle? -
Littl3j0hNy - 24.09.2013
I think you mean UpdateVehicleDamageStatus.
just add this into your script:
pawn Код:
encode_lights(light1, light2, light3, light4) return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
encode_tires(tire1, tire2, tire3, tire4) return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
encode_panels(flp, frp, rlp, rrp, windshield, front_bumper, rear_bumper) return flp | (frp << 4) | (rlp << 8) | (rrp << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24);
encode_doors(bonnet, boot, driver_door, passenger_door) return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24);
Use:
pawn Код:
UpdateVehicleDamageStatus(vehicleid, panels, doors, encode_lights(0, 0, 0, 0), tires);