SA-MP Forums Archive
About headshots.. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: About headshots.. (/showthread.php?tid=138118)



About headshots.. - lameguy - 31.03.2010

Hi,
I want script which instantly kills the other player, when you shoot him with sniper to head.
I've been looking around on forums, but i haven't found any which would work correctly.
But since R7 server was released, i started to think if it's now possible to detect headshots correctly.
Maybe with function GetPlayerCameraFrontVector?
it seemed for me the most promising one.

So is it possible to create script which detects the headshots shot with sniper correctly.
And if it is, i would appreciate if someone could accomplish it.

Best Regards, Johnson_boy


Re: About headshots.. - Jay420 - 31.03.2010

I think this can't be implemented.

You can detect the damage the weapon makes, and set the player health to "0" if it's the snipers damage though.
The head shot detecting would be awesome.


Re: About headshots.. - Joe Staff - 31.03.2010



heheh


Re: About headshots.. - [MWR]Blood - 31.03.2010

Quote:
Originally Posted by Joe Staff


heheh
Just message, he didn't die.


Re: About headshots.. - Joe Staff - 31.03.2010

It's a bot

He's just there for testing, if you hadn't noticed, it said HEAD SHOT only when I... shot his head...


Re: About headshots.. - bajskorv123 - 31.03.2010

Quote:
Originally Posted by Joe Staff
It's a bot

He's just there for testing, if you hadn't noticed, it said HEAD SHOT only when I... shot his head...
Omg gimme gimme gimme code

Pm if you dont wanna post just gimme

Or you use that cleo Headshot script? :P


Re: About headshots.. - Jay420 - 31.03.2010

Quote:
Originally Posted by Joe Staff
It's a bot

He's just there for testing, if you hadn't noticed, it said HEAD SHOT only when I... shot his head...
Lol.. Seems like the text appears every time you shoot someone where ever you just hit or something.
But I doubt the headshot detecting can be implemented in the current version of SA:MP.


Re: About headshots.. - Joe Staff - 31.03.2010

Quote:
Originally Posted by Jay420
But I doubt the headshot detecting can be implemented in the current version of SA:MP.
For players, of course not, but since NPCs don't have a true response to players, it can be implemented for them.

I've learned quite a lot of things working on Camera Detection.
The player's camera coordinates (as far as the server is concerned) is only accurate when the player is aiming (or KEY_HANDBRAKE, 128, is being pressed) Otherwise, it updates about once per second.
The camera's coordinates aren't offsets of the player's angle, but rather offsets of the players position in coordinance to the world (so if you're looking north, the X coordinate will be 0, regardless of the player's facing angle)
Getting the actual vertical and horizontal angle is a pain in the ass >:|


Re: About headshots.. - lameguy - 01.04.2010

So is it possible or not?


Re: About headshots.. - cozza123456 - 01.04.2010

Quote:
Originally Posted by Joe Staff
Quote:
Originally Posted by Jay420
But I doubt the headshot detecting can be implemented in the current version of SA:MP.
For players, of course not, but since NPCs don't have a true response to players, it can be implemented for them.
No.. Read next time.