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

I need to create a fire man system but i can't detect that a player is spraying water at the fire.
i tried to use fire extinguisher but the fire extinguisher was not spraying anything out.

Anyone can help me
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=105568
Reply
#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
#4

Ya i know but how to detect if is the player spray to the position
Reply
#5

Check players angle, get players vehicle/weapon, check if player is holding down KEY_FIRE and check if player is in range of the fire
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)