How to detect if a player is under 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to detect if a player is under a vehicle? (
/showthread.php?tid=278672)
How to detect if a player is under a vehicle? -
Whizion - 23.08.2011
I want to punish those who kill by parking a car over you.
A made something with OnPlayerDeath but it's useless if a player who parks the vehicle exit's...
So i need something different.. i need to detect if a player is under a vehicle...
Does anyone know how to do this? Thank you.
Re: How to detect if a player is under a vehicle? -
Pinguinn - 23.08.2011
I read it wrong, sorry
Re: How to detect if a player is under a vehicle? -
Gamer_Z - 23.08.2011
maybe use GetPlayerAnimation?
Re: How to detect if a player is under a vehicle? -
CyNiC - 23.08.2011
Use these functions:
GetPlayerAnimationIndex(playerid)
GetVehivlePos
IsPlayerInRangeOfPoint
If the player animation index is 1126 and he is in the range of position of some car, he's under a vehicle.
It's not 100% accurately