AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] tHeadshotOnly v2.0.1 (2014.05.30) (https://forums.alliedmods.net/showthread.php?t=114489)

Thrawn2 01-05-2010 06:56

[TF2] tHeadshotOnly v2.0.1 (2014.05.30)
 
3 Attachment(s)
Allows modifying the damage dealt by headshots and bodyshots with weapons that can actually do headshots.
Uses SDKHooks.

Cvars:
Quote:

Allows enabling/disabling the plugin
  • sm_theadshotonly_enable (default: 1)

Quote:

The location/name of the config file used for the modifiers.
  • sm_theadshotonly_cfgfile (default: tHeadshotOnly.cfg, which resolves to /tf/addons/sourcemod/configs/tHeadshotOnly.cfg)

Quote:

These control how much damage is being dealt when not zoomed in. (0.0 means no damage at all, 0.5 half, 1.0 full, 2.0 double and so on)
  • sm_theadshotonly_noscope_body (modifier for no-scope bodyshot damage dealt, default: 0.0, no-scopes deal no damage).
  • sm_theadshotonly_noscope_head (modifier for no-scope headshot damage dealt, default: 1.0, no-scopes deal normal damage).

Quote:

By enabling this the attacker will see the miss particle when hitting a body part. There are no other notifications.
  • sm_theadshotonly_particle (default: 1, only shows when the damage modifier of the weapon is set to 0.0 to avoid mixed visual feedback)

Config file details:
The config file is being generated/updated with new weapons automatically. This is just a snapshot of the file generated on 2014-05-29 and might not include all weapons that are available today.
Code:

"tHeadshotOnly"
{
        "Weapons without scope"
        {
                "The Ambassador"                                "1"
                "Festive Ambassador"                                "1"
                "The Huntsman"                                        "1"
                "Festive Huntsman"                                "1"
                "The Fortified Compound"                        "1"
        }
        "Bodyshot Modifiers"
        {
                "TF_WEAPON_SNIPERRIFLE"                                "0.000000"
                "Upgradeable TF_WEAPON_SNIPERRIFLE"                "0.000000"
                "Festive Sniper Rifle 2011"                        "0.000000"
                "Silver Botkiller Sniper Rifle Mk.I"                "0.000000"
                "Gold Botkiller Sniper Rifle Mk.I"                "0.000000"
                "Rust Botkiller Sniper Rifle Mk.I"                "0.000000"
                "Blood Botkiller Sniper Rifle Mk.I"                "0.000000"
                "Carbonado Botkiller Sniper Rifle Mk.I"                "0.000000"
                "Diamond Botkiller Sniper Rifle Mk.I"                "0.000000"
                "Silver Botkiller Sniper Rifle Mk.II"                "0.000000"
                "Gold Botkiller Sniper Rifle Mk.II"                "0.000000"

                "The Bazaar Bargain"                                "0.000000"
                "The Machina"                                        "0.000000"
                "The Hitman's Heatmaker"                        "0.000000"
                "The AWPer Hand"                                "0.000000"
               
                "The Ambassador"                                "1.000000"
                "Festive Ambassador"                                "1.000000"
               
                "The Huntsman"                                        "0.000000"
                "Festive Huntsman"                                "0.000000"
                "The Fortified Compound"                        "0.000000"
        }
        "Headshot Modifiers"
        {
                "TF_WEAPON_SNIPERRIFLE"                                "1.000000"
                "Upgradeable TF_WEAPON_SNIPERRIFLE"                "1.000000"
                "Festive Sniper Rifle 2011"                        "1.000000"
                "Silver Botkiller Sniper Rifle Mk.I"                "1.000000"
                "Gold Botkiller Sniper Rifle Mk.I"                "1.000000"
                "Rust Botkiller Sniper Rifle Mk.I"                "1.000000"
                "Blood Botkiller Sniper Rifle Mk.I"                "1.000000"
                "Carbonado Botkiller Sniper Rifle Mk.I"                "1.000000"
                "Diamond Botkiller Sniper Rifle Mk.I"                "1.000000"
                "Silver Botkiller Sniper Rifle Mk.II"                "1.000000"
                "Gold Botkiller Sniper Rifle Mk.II"                "1.000000"

                "The Bazaar Bargain"                                "1.000000"
                "The Machina"                                        "1.000000"
                "The Hitman's Heatmaker"                        "1.000000"
                "The AWPer Hand"                                "1.000000"

                "The Ambassador"                                "1.000000"
                "Festive Ambassador"                                "1.000000"

                "The Huntsman"                                        "1.000000"               
                "Festive Huntsman"                                "1.000000"
                "The Fortified Compound"                        "1.000000"
        }
}

Note:
This plugin does not work correctly if you set the critchance to 100% and are running a version of SDKHooks earlier than 2.1.

Credits to:
  • Duke for his TempEnts Particle Function.
  • Tsunami for SDKHooks
  • psychonic for additional suggestion + sdkhooks2 + sdkhooks 2.1 ;)
  • cybersquare420 found two nasty bugs
  • CynderWolf for reminding me to add the bazaar bargain
  • Jameless for providing some fixes

Changelog:
A more detailed changelog can be found on here.
2.0.0
- Rewrite, no more hardcoded values.
1.1.5
- More skins
1.1.3
- added the 'Hitmans Heatmaker' and the 'AWPer Hand'
1.1.2
- added the 'Festive Sniper Rifle'.
1.1.1
- fixed clients having no active weapon, but still doing damage, spam the console.
- removed additional build only DREAD_XI was using. i cba to do everything twice.
1.1.0
- updated to use sdkhooks 2.1 and therefore changed headshot detection (thanks to psychonic)
- added machina, sidney sleeper and noscope cvars.
1.007
- fixed bazaar bargain stuff. (thx to CynderWolf for reporting)
1.006
- included bazaar bargain
1.005
- fixed for sdkhooks2
1.004
- removed upper limit (1.0) for the multiplier cvars (requested here)
1.003
- same for the inflictor.
1.002
- it's not enough to check if attacker > 0. obviously. fixed.
1.001
- Changed boolean cvars to float to be used as a modifier for the damage hook.
1.000
- Initial Release

cybersquare420 01-05-2010 08:45

Re: [TF2] tHeadshotOnly v1.000 (2010.01.05)
 
THANX for THIS!!!!

psychonic 01-05-2010 09:08

Re: [TF2] tHeadshotOnly v1.000 (2010.01.05)
 
Request:
Change the enable/disable cvar for each weapon to a float to be used as a modifier for body-shot damage.

Like:
0.0 - No damage
0.5 - Half damage
1.0 - Full damage (disabled)

Thrawn2 01-05-2010 11:26

Re: [TF2] tHeadshotOnly v1.001 (2010.01.05)
 
although this turns around my cvars (0 becomes 1.0 and 1 becomes 0.0) its a welcome suggestion.
i've updated the plugin accordingly.

cybersquare420 01-06-2010 22:05

Re: [TF2] tHeadshotOnly v1.001 (2010.01.05)
 
log spam:

L 01/06/2010 - 22:04:02: [SM] Native "GetClientWeapon" reported: Client index 103 is invalid
L 01/06/2010 - 22:04:02: [SM] Displaying call stack trace for plugin "tHeadshotOnly.smx":
L 01/06/2010 - 22:04:02: [SM] [0] Line 61, tHeadshotOnly.sp::OnTakeDamage()

Thrawn2 01-07-2010 01:44

Re: [TF2] tHeadshotOnly v1.002 (2010.01.07)
 
facepalm
obvious bug is fixed

cybersquare420 01-07-2010 21:52

Re: [TF2] tHeadshotOnly v1.002 (2010.01.07)
 
more spam...
L 01/07/2010 - 21:43:26: [SM] Native "GetPlayerWeaponSlot" reported: Entity index 358 is not a valid client
L 01/07/2010 - 21:43:26: [SM] Displaying call stack trace for plugin "tHeadshotOnly.smx":
L 01/07/2010 - 21:43:26: [SM] [0] Line 78, tHeadshotOnly.sp::OnTakeDamage()

Thrawn2 01-08-2010 01:12

Re: [TF2] tHeadshotOnly v1.003 (2010.01.08)
 
fixed

Senapi 03-15-2010 23:58

Re: [TF2] tHeadshotOnly v1.004 (2010.02.15)
 
I can't this working on my server could someone please help me

Thrawn2 03-16-2010 08:28

Re: [TF2] tHeadshotOnly v1.004 (2010.02.15)
 
more details pls.
do you have sdkhooks installed?
please post the output of sm exts list and sm plugins list


All times are GMT -4. The time now is 05:06.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.