SA-MP Forums Archive
Shoot in a car = turn off the engine - 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: Shoot in a car = turn off the engine (/showthread.php?tid=635647)



Shoot in a car = turn off the engine - SonicFreeStyle - 11.06.2017

Hey guys! I did a system some years ago that when a cop shoots with the weapon 34 (country rifle) in a car, the engine turns off, but i totally forgot how to do it!

i was thinking about "OnPlayerWeaponShot" but i can't set the vehicle to turn off the engine so...how i can make this system?? i only remember that i used

pawn Код:
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
to turn off the engine

PS: Sorry for the bad english, i'm brazilian and in the portuguese forum we don't have good scripters...


Re: Shoot in a car = turn off the engine - Banditul18 - 11.06.2017

https://sampforum.blast.hk/showthread.php?tid=577156
Use the OnPlayerShotVehicle callback from here, so you can take the vehicleid and the weaponid


Re: Shoot in a car = turn off the engine - SonicFreeStyle - 11.06.2017

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=577156
Use the OnPlayerShotVehicle callback from here, so you can take the vehicleid and the weaponid
OH YEAH THANKS MAN!!! I was searching only simple functions!! Thanks dude! REP+!


Re: Shoot in a car = turn off the engine - GoldenLion - 11.06.2017

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=577156
Use the OnPlayerShotVehicle callback from here, so you can take the vehicleid and the weaponid
He could simply use OnPlayerWeaponShot. If he shoots a vehicle then "hitid" is the shot vehicle's id.


Re: Shoot in a car = turn off the engine - Banditul18 - 11.06.2017

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
He could simply use OnPlayerWeaponShot. If he shoots a vehicle then "hitid" is the shot vehicle's id.
Oh damn, i really don't know that actually. I was thinking there is no vehicleid or something to return it. Well thanks for info....

EDIT: Just open the vehicleplus include and saw that...


Re: Shoot in a car = turn off the engine - SonicFreeStyle - 11.06.2017

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
He could simply use OnPlayerWeaponShot. If he shoots a vehicle then "hitid" is the shot vehicle's id.
i tried but idk how to get the vehicle ID on the OnPlayerWeaponShot but thanks!