10.02.2010, 08:49
You can't detect exactly where someone is looking.
You can get the direction using https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle
For detecting if someone has fired, you can check https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
and check if they pressed and held the fire key down (issue, sometimes tapping doesn't == firing) so use the hold system maybe(explained in link)
Whether someone is hurt or not, is another issue, check if someone nearby has taken damage.
There are a few scripts that take advantage of this system,
I would take a look at this one: [INC] One Shot One Kill
If you look in their script you will see all this stuff under his OnPlayerKeyStateChange. It detects if someone is aiming at someone else.
Unfortunately it is still limited
But of course, for everdrawback, you can find a fix:
Hope that helps and isn't too much information.
You can get the direction using https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle
For detecting if someone has fired, you can check https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
and check if they pressed and held the fire key down (issue, sometimes tapping doesn't == firing) so use the hold system maybe(explained in link)
Whether someone is hurt or not, is another issue, check if someone nearby has taken damage.
There are a few scripts that take advantage of this system,
I would take a look at this one: [INC] One Shot One Kill
If you look in their script you will see all this stuff under his OnPlayerKeyStateChange. It detects if someone is aiming at someone else.
Unfortunately it is still limited
Quote:
Originally Posted by Chaser98
You can simply aim to the sky above someone and shoot... it will kill them. That's because there's no way in SAMP to get the player's camera Z angle.
Would be nice if someone could make a simple plugin that will retrieve it. |
Quote:
Originally Posted by Marcel
You could check if the player loses health.
|