Remove vehicle doors - 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: Remove vehicle doors (
/showthread.php?tid=489891)
Remove vehicle doors -
Nourdin - 24.01.2014
Hello there,
I'm looking for someone that can explain me how I can remove a vehicle door. I have seen numerous tutorials and threads about removing door vehicles but didn't really understood it due the byte codes (??). It would be greatly appreciated if someone can help me out as it's quite urgent. I'm going to hand out a special reputation for the one that helps me out with this.
Thanks in advance.
Re: Remove vehicle doors -
Wizz123 - 24.01.2014
https://sampwiki.blast.hk/wiki/UpdateVehicleDamageStatus
Re: Remove vehicle doors -
Dragony92 - 24.01.2014
pawn Код:
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
doors = encode_doors(4, 4, 4, 4, 0, 0);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
encode_doors(bonnet, boot, driver_door, passenger_door, behind_driver_door, behind_passenger_door)
{
#pragma unused behind_driver_door
#pragma unused behind_passenger_door
return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24);
}
Re: Remove vehicle doors -
Wizz123 - 24.01.2014
Quote:
Originally Posted by Dragony92
pawn Код:
new panels,doors,lights,tires; GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); doors = encode_doors(4, 4, 4, 4, 0, 0); UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
encode_doors(bonnet, boot, driver_door, passenger_door, behind_driver_door, behind_passenger_door) { #pragma unused behind_driver_door #pragma unused behind_passenger_door return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24); }
|
This is not gonna work instead of making it higher you lower it, im not 100 percent sure on how to do this but the UpdateVehicleDamageStatus function got something to do with it.
Re: Remove vehicle doors -
Nourdin - 24.01.2014
Should I add that piece of code in the command so it works or do I need to take information from them?
Re: Remove vehicle doors -
Dragony92 - 24.01.2014
In command or whereever you want...
pawn Код:
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
doors = encode_doors(4, 4, 4, 4, 0, 0);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
function
pawn Код:
encode_doors(bonnet, boot, driver_door, passenger_door, behind_driver_door, behind_passenger_door)
{
#pragma unused behind_driver_door
#pragma unused behind_passenger_door
return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24);
}