Checking aim or shooting?
#1

Is there any way to check if you're aiming at something or if you shot(but not necessarily killed) someone/something?

Thanks
Reply
#2

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
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.
But of course, for everdrawback, you can find a fix:
Quote:
Originally Posted by Marcel
You could check if the player loses health.
Hope that helps and isn't too much information.
Reply
#3

Well I'm not sure that helps me.

I'd like that when a player presses a key, an explosion occurs at the point he aims. But I guess thats impossible.
Reply
#4

Well you can make an explosion happen in front of someone, just not up or down from them.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)