How to detect fire truck spraying water at a point???
#3

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
Irrelevant post

You can detect if a player is spraying by checking the keys he is pressing.
You can use these callbacks/functions to find out what keys are being pressed:
OnPlayerKeyStateChange
GetPlayerKeys

The player has to press KEY_FIRE to spray water.

You can then find out in which direction he is facing using GetPlayerFacingAngle.You can then create a virtual sphere around your point and find out if the line drawn along the direction of facing angle of the player intersects the point or passes close to the point by doing some simple math.

https://sampforum.blast.hk/showthread.php?tid=573385
You can get an idea how to do the math from here.
Reply


Messages In This Thread
How to detect fire truck spraying water at a point??? - by JawsPlus - 07.06.2015, 09:15
Re: How to detect fire truck spraying water at a point??? - by JaydenJason - 07.06.2015, 09:34
Re: How to detect fire truck spraying water at a point??? - by Yashas - 07.06.2015, 09:49
Re: How to detect fire truck spraying water at a point??? - by JawsPlus - 07.06.2015, 10:36
Re: How to detect fire truck spraying water at a point??? - by JaydenJason - 07.06.2015, 11:25

Forum Jump:


Users browsing this thread: 1 Guest(s)