SA-MP Forums Archive
Detect player hitting 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: Detect player hitting vehicle (/showthread.php?tid=569048)



Detect player hitting vehicle - PaulDinam - 27.03.2015

Is there a way to detect weather a player has used a baseball or a fist on a vehicle, I already made a code that checks if a player pressed KEY FIRE and is holding a baseball bat but is there a way to actually verify if he hit the vehicle's door and not just the air?


Re: Detect player hitting vehicle - Nicker - 27.03.2015

You could try using OnVehicleDamageStatusUpdate and getting the players animation to check if they're holding a baseball bat, perhaps? (Animations)

Other things you might find useful:

GetPlayerAnimationIndex
GetAnimationName