Raised This Month: $66 Target: $400
 16% 

Headshot Modes


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay        Approver:   Hawk552 (427)
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-01-2010 , 20:57   Headshot Modes
Reply With Quote #1

Headshot Modes
Version 1.5


Description:
[SIZE=2][COLOR=black]This allows the server admin using per map configs to allow/disallow headshots. It also blocks bots for giving head shots.

The reason for blocking headshots for every one is due to newbies. I have seen some servers where its focused for noobs. So blocking headshots should give them a little more chance at understanding the game play while surviving more then 30 seconds.

Also allows server admins to set headshot only for training reasons.

Then for kicks and giggles i added a 4th value to allow all shots to count as headshots .. Could be interesting and extremely hard at the same time.

Tested in CZ. Should now work on all mods.

Cvars:
hs_mode <1>
  • 0 Disables the mod
  • 1 Blocks bots from giving headshots ( Can be set to hit chest via the second cvar)
  • 2 Blocks all headshots (good for beginier servers... Can be set to hit chest via the second cvar)
  • 3 Blocks all hitzones except headshots
  • 4 Changes all hitzones to headshots

hs_chest <0>
  • 0 Blocks headshots entirely
  • 1 Redirects the headshot to the chest

hs_knife <0>
  • 0 Blocks knife headshots
  • 1 Allows knife headshots

Credits:
ToDo List:
  • None
Change log:


1.0
Initial Release
1.1
Checks for valid attacker.
Ignores Knife kills.
Added a cvar to block head shot or redirect to chest
1.2
Checks for valid Attacker and Victim
Fixed my returns yet again thanks connor
1.3
Fixed some bugs. (would block all hitgroups not just head)
Removed the "n" on my cvars now match title of plugin.
1.4
Using Connors Method for registering bots with HAM
Added a Native to change the hs mode and hit chest mode.
1.5
Registers the bots using rage.
Fixed a typo in the code (cz bots were never hooked)
Attached Files
File Type: sma Get Plugin or Get Source (hs_modes.sma - 2917 views - 3.2 KB)
__________________

Last edited by Doc-Holiday; 05-25-2013 at 07:17.
Doc-Holiday is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 02-02-2010 , 12:52   Re: Headshot Modes
Reply With Quote #2

Knife headshoot ?!?!

PHP Code:
        if( get_user_weaponattacker ) == CSW_KNIFE )
            return 
HAM_IGNORED
Also i think you should filter if the victim/attacker are players.
__________________
Javivi is offline
Old 02-02-2010, 12:55
Doc-Holiday
This message has been deleted by Doc-Holiday.
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-02-2010 , 13:00   Re: Headshot Modes
Reply With Quote #3

Quote:
Originally Posted by Javivi View Post
Knife headshoot ?!?!

PHP Code:
        if( get_user_weaponattacker ) == CSW_KNIFE )
            return 
HAM_IGNORED
Also i think you should filter if the victim/attacker are players.

The way i coded this is not really for knifes. The reason for it is mainly for training. and or beginners servers. So the knife is rarely used but if you tell me what exactly you would like with the knife i can add it in.. also. ill filter through the players. to make sure valid attacker.


Updated!
__________________

Last edited by Doc-Holiday; 02-02-2010 at 13:05.
Doc-Holiday is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 02-02-2010 , 13:37   Re: Headshot Modes
Reply With Quote #4

I say that make a headshoot with a knife is hard and that you should ignore knife hits.
__________________
Javivi is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-02-2010 , 13:45   Re: Headshot Modes
Reply With Quote #5

PHP Code:
                    set_tr2(traceresultTR_iHitgroupHIT_CHEST//uncomment to make headshots hit the chest
                    
return HAM_HANDLED //uncomment to make headshots hit the chest
                    //return HAM_SUPERCEDE //comment to make headshots hit the chest 
This should be setable w/o having to edit the source code.
Why don't you just add other possible cvar values ?
__________________
- tired and retired -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-02-2010 , 14:39   Re: Headshot Modes
Reply With Quote #6

Quote:
Originally Posted by Javivi View Post
I say that make a headshoot with a knife is hard and that you should ignore knife hits.

Added the following to 1.1

Makes sure Valid attacker
Allows admin to block or allow knife headshots
Allows admin to decide to block or redirect headshots
__________________

Last edited by Doc-Holiday; 02-02-2010 at 14:59.
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-02-2010 , 16:29   Re: Headshot Modes
Reply With Quote #7

Check your cvar spelling.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 02-02-2010 , 17:22   Re: Headshot Modes
Reply With Quote #8

You should check if the victim is not the attacker (HE nade)

PHP Code:
if( Vic != Att 
__________________
Javivi is offline
laziboi72
Senior Member
Join Date: Aug 2009
Location: deathrun_temple
Old 02-02-2010 , 20:48   Re: Headshot Modes
Reply With Quote #9

nice
its almost like a death match mode where everyone dies in like one or two hits
__________________
Taking a break from modding dunno when i will be back

FAIL, RIGHT HERE
laziboi72 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-03-2010 , 01:19   Re: Headshot Modes
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
Check your cvar spelling.
My nickname here at home is King Typo... Shows even here.




Fixed aswell as checking if vic != attacker
__________________

Last edited by Doc-Holiday; 02-03-2010 at 01:21.
Doc-Holiday is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:30.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode