Detect if player is in front of the object - 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 if player is in front of the object (
/showthread.php?tid=662977)
Detect if player is in front of the object -
None1337 - 17.01.2019
So, I want to know how can I detect if a player has the camera look at a object, like, you are using photo camera (weapon 43) and you are looking with the camera at object 1247 (police star).
How can I detect that?
Re: Detect if player is in front of the object -
B3x7K - 17.01.2019
Maybe you can check it like:
PHP код:
if(pPosX == objPosX)
{
//do something here
}
or simply use IsPlayerInRangeOfPoint.
Re: Detect if player is in front of the object -
None1337 - 17.01.2019
done