[FilterScript] [FS] BoOm Headshot!!!
#1

Infinite-Gaming.com Presents:
A Tannz0rz and Cyber_Punk Production
(in other words scripted by us)

BoOm Headshot

Intro:

Before I get to the nitty gritty, first off I would like to explain exactly what this script does, what it intends to do and finally what it will pull off. This is nothing more than a line tracer that takes 3d camera coordinates and translates it on your screen. The goal of this line trace is to have the line end in the location you had your cross hairs at the moment you hit the fire key. While that's what the line does, the script on the other hand checks at a per unit basis (1.0 GTA unit) if a player happens to be in that path at the moment that line hits him. If that line is near his head, BoOm Headshot.

There is no hocus pocus, no trickery and defiantly no hit boxes involved.


Before we released this script we wanted to get a good understanding of just how everything would play out, especially in the processing department. We could have had it out sooner but there was some testing to be done and also had to fix bullets from shooting out behind you :P (yes thats fixed).


What you need to know:


Surprisingly with a 50 player loop (standard loop) it took the headshot function an average of 7 to 8ms to complete that was at the max distance of 100.0 units (Sniper Rifle), with foreach it was 0 to 1 but that was with one player on the server. To further test the function I made the loop max at 500 and stuff an array of 500 locations into the IsPointInRangeOfPoint. The end result with 500 players (pseudo connected test - real results may vary) was about 76 to 78ms. The ranges used for the weapons all came from weapons.dat, the amount of time to process the function decreases after the Sniper Rifle. Small handguns take an average of 22 to 25ms with 500 players (due to the shorter distance checks).

For a high player count server it is recommended that you do not comment out CONSERVATIVE mode

How To Use:

pawn Код:
//======Config Options
//#define DEBUG
//#define NO_LOS //Uncomment this if you want no "Line of Sight" with your DEBUG mode
//#define FOR_EACH
#define CONSERVATIVE  //Comment for servers less than 100 players....Use @ your own risk.
#define DESTROY_LOS 500 //Time in milliseconds to remove line of sight objects
#undef MAX_PLAYERS
    #define MAX_PLAYERS 50 //Set to your max players

//======End Options
This is the default configuration, first be sure to set your MAX_PLAYERS. Then if you prefer foreach (by ******) and you have it in your include folder you can uncomment #define FOR_EACH, this will set up its own itter for the processing. For everyone's curiosity I left the debug mode in including the line of sight code. To use debug simply uncomment the line, if you don't want the i icons uncomment #define NO_LOS, alternatively you can also set the amount of time before the icons disappear with DESTROY_LOS.

Conservative Mode:
There are 2 modes to run BoOm Headshot by, the default is a conservation mode to prevent rapid fire headshot detection from lagging your server. While it has not been test in the real world, speed test results on a dual core processor shown that an extreme numbers of players firing weapons at the same time might lag your server (again all theory haven't really tested on that scale). To comment out conservative mode on a high player number server is done at your own risk.

For servers with 50 players the time to process was much much faster, 7ms and allows for rapid fire weapons to potentially detect headshots with every shot fired (give or take a few sync/timing isn't always perfect)

Videos:
http://forum.sa-mp.com/index.php?topic=163156.0


Final Notes:
The distance loop will end if a success full hit, this further helps speed up processing time. There is no object or health detection method on this script. During testing we found that it was hardly an issue, to be honest I have never seen so many draw kills (where both attackers kill each other) till this script, even with higher pinged players. If the need arises we may put something in.

*Could we detect nut shoots* YES! - Why didn't we? Well we were going to then I made headshots work for crouched players instead. Maybe next version.

Download:
www.infinite-gaming.com/iG_BoOm_Headshot.zip

Reply
#2

Wow nice work
Reply
#3

Very nice work there CP!
Reply
#4

Very nice. 10/10
Reply
#5

good work
Reply
#6

I suggest to call foreach (foreach2 to be exact) for streamed players only instead of looping through all the connected players.
Reply
#7

0.o you released it... nice!
Reply
#8

Nice work nab. Hf
Reply
#9

Quote:
Originally Posted by Seif_
How accurate is this?
Pretty accurate. Also detects when players are crouched as well.
Reply
#10

Quote:
Originally Posted by CrαcK
I suggest to call foreach (foreach2 to be exact) for streamed players only instead of looping through all the connected players.
Possibly I could do that in the next version/

Quote:
Originally Posted by XxCozzaxX
0.o you released it... nice!
Yes Tannz0rz and I was always planned on releasing it.

Quote:
Originally Posted by Seif_
How accurate is this?
Pretty damn accurate. Everyone involved in the beta tests loved it, shit I wish this was around in my rp days, sure would have made for some nice ass executions. I took a look at yours I didn't see the custom offset for the country rifle? Did you not test and see the country rifle had its own offset, its not 0.0 like the sniper rifle.........
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)