Raised This Month: $159 Target: $400
 39% 

[L4D & L4D2] Reverse Friendly-Fire [v2.9 (09-Oct-2024)]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Plugin ID:
7408
Plugin Version:
2.9
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    50 
    Plugin Description:
    Reverses friendly-fire... attacker takes damage, victim does not.
    Old 12-05-2020 , 18:49   [L4D & L4D2] Reverse Friendly-Fire [v2.9 (09-Oct-2024)]
    Reply With Quote #1

    .
    Reverse Friendly-Fire (l4d_reverse_ff) by Mystik Spiral

    Reverses friendly-fire.
    Attacker takes damage, victim does not.


    Objectives:
    • Do not allow griefers to cause friendly-fire damage to other players.
    • Incentivize all players to improve their shooting tactics and aim.

    Description and options:

    Reverses friendly-fire weapon damage on survivor team and claw attacks on infected team.
    Does not reverse burn/blast damage, except for grenade launcher and incendiary/explosive ammo.
    Supports client language translation: English, French, Spanish, Russian, and Traditional Chinese.

    Options for the true(1) / false(0) parameters below:

    · 1 = friendly-fire is reversed for that option and the attacker takes damage.
    · 0 = friendly-fire is disabled for that option and the attacker does not take damage.
    • ReverseFF when attacker is an admin. [reverseff_admin (default: 0)]
    • ReverseFF when victim is a bot. [reverseff_bot (default: 0)]
    • ReverseFF when victim is incapacitated. [reverseff_incapped (default: 0)]
    • ReverseFF when attacker is incapacitated. [reverseff_attackerincapped (default: 0)]
    • ReverseFF when damage from mounted gun. [reverseff_mountedgun (default: 1)]
    • ReverseFF when damage from melee weapon. [reverseff_melee (default: 1)]
    • ReverseFF when damage from chainsaw. [reverseff_chainsaw (default: 1)]
    • ReverseFF during Smoker pull or Charger carry. [reverseff_pullcarry (default: 0)]
    _____________________________________________
    Options for the damage modifier parameters below:

    Range: 0.0 - 2.0
    • 0.0 = disabled
    • 0.1 = 10% of real damage
    • 0.5 = 50% of real damage
    • 1.0 = 100% of real damage
    • 1.125 = 112.5% of real damage (12.5% extra damage)
    • 2.0 = 200% of real damage
    • Infected attacker damage. [reverseff_dmgmodinfected (default: 1.0)]
    • Survivor attacker damage. [reverseff_dmgmodifier (default: 1.0)]
    • Survivor attacker extra damage when using explosive/incendiary ammo. [reverseff_multiplier (default: 1.125)]
    • Survivor bot victim damage. [reverseff_botdmgmodifier (default=0.0)]
    • Survivor human victim damage. [reverseff_humandmgmodifier (default=0.0)]
    _____________________________________________
    Additional options:
    • Specify maximum survivor damage allowed per chapter before kick/ban (0=disable). [reverseff_survivormaxdmg (default: 200)]
    • Specify maximum infected damage allowed per chapter before kick/ban (0=disable). [reverseff_infectedmaxdmg (default: 50)]
    • Specify maximum tank damage allowed per chapter before kick/ban (0=disable). [reverseff_tankmaxdmg (default: 300)]
    • Specify kick/ban duration in minutes (0=permanent ban, -1=kick instead of ban). [reverseff_banduration (default: 10)]
    • ReverseFF based on distance between victim and attacker (0=disable). [reverseff_proximity (default: 32)]
    • ReverseFF based on cooldown timer (0=disable). [reverseff_cooldowntime (default: 0)]
    • Enable/disable stumble effect from grenade launcher friendly-fire (0=disable). [reverseff_glstumble (default: 0)]
    • Enable/disable plugin (0=Plugin off, 1=Plugin on). [reverseff_enable (default=1)]
    • Enable/disable plugin by game mode. [reverseff_modes_on, reverseff_modes_off, reverseff_modes_tog]
    • Enable/disable plugin announcement (0=Announcement off, 1=Announcement on). [reverseff_announcement (default=1)]
    • Display/suppress ReverseFF chat messages (0=Suppress chat messages, 1=Display chat messages). [reverseff_chatmsg (default=1)]

    Notes:

    Added two new parameters by popular demand to allow victim damage...
    Survivor bot victim: reverseff_botdmgmodifier
    Survivor human victim: reverseff_humandmgmodifier

    These two parameters control how much damage friendly-fire victims take, and operate independently of the parameters that control how much friendly-fire damage is reversed to attackers. If you want survivor attackers to have 80% of damage reversed, survivor bot victims to take 100% of damage, and survivor human victims to take 50% of damage, then you would set:
    reverseff_dmgmodifier "0.8"
    reverseff_botdmgmodifier "1.0"
    reverseff_humandmgmodifier "0.5"
    Without this plugin, if you shoot another player while they are being pulled by the Smoker (before they are choked) or while being carried by the Charger (before they are pummeled), the game engine would trigger friendly-fire. Setting reverseff_pullcarry=0 allows you to turn this off, and is the default. The game engine does not generate friendly-fire if you shoot another player while they are pinned by the Hunter or Jockey and is not affected by the reverseff_pullcarry setting.

    The proximity feature (reverseff_proximity) compares the distance between the attacker and victim, and if the distance is less than reverseff_proximity, ignores friendly-fire. The default value is 32, which is where players bodies are so close they begin to overlap. However, you could also set it to a lower value (more body overlap before friendly-fire is ignored) or a higher value to provide a buffer around you for griefers/idiots that run through or in front of you while you are firing. Also note this feature ignores melee weapons and chainsaw... those will always generate friendly-fire (unless you have one of the other ConVars set to negate that). You can disable this feature by setting reverseff_proximity=0. If you want the opposite effect... ignore friendly-fire when the distance is greater than reverseff_proximity (instead of less than) then set reverseff_proximity to a negative value.


    Code/Discussion:

    GitHub
    AlliedModders


    Acknowledgements:
    Spoiler

    Most recent update:
    Spoiler

    Full changelog:
    Spoiler

    The phrases file is REQUIRED, and must be downloaded/copied to the "addons\sourcemod\translations" directory.
    .
    Attached Files
    File Type: txt l4d_reverse_ff.phrases.txt (2.7 KB, 1917 views)
    File Type: sp Get Plugin or Get Source (l4d_reverse_ff.sp - 399 views - 36.1 KB)
    __________________

    Last edited by Mystik Spiral; 10-13-2024 at 09:39. Reason: updated version
    Mystik Spiral is offline
    Mystik Spiral
    Senior Member
    Join Date: Oct 2020
    Location: Orlando, FL
    Old 12-05-2020 , 19:13   Re: [L4D2] Reverse Friendly-Fire [v1.0 (05-Dec-2020)]
    Reply With Quote #2

    I know there are many friendly-fire plugins out there already, but it has been my experience that most of them do not work at all or have too many bugs to be useful. I had been using one of those other plugins for a while, and fixed several bugs with it, but some things just could not be fixed (hooking player_hurt), so I created this new plugin using the new (SM 1.7+) syntax. This plugin hooks SDKHook_OnTakeDamage to intercept damage, and uses SDKHooks_TakeDamage to reverse the damage. Note that if you shoot a teammate with explosive ammo, you (the attacker) will be stumbled, not the victim. Similarly, if you shoot a teammate with incendiary ammo, you (the attacker) will be lit on fire for a few seconds, not the victim.

    Last edited by Mystik Spiral; 12-21-2020 at 13:36.
    Mystik Spiral is offline
    user2000
    Member
    Join Date: Nov 2015
    Location: Peru - Lima
    Old 12-05-2020 , 21:54   Re: [L4D2] Reverse Friendly-Fire [v1.0 (05-Dec-2020)]
    Reply With Quote #3

    interesting I'm going to try it

    thanks
    user2000 is offline
    Lolfaceftw
    Junior Member
    Join Date: Dec 2020
    Old 12-05-2020 , 22:24   Re: [L4D2] Reverse Friendly-Fire [v1.0 (05-Dec-2020)]
    Reply With Quote #4

    Awesome. I'll try this I already have the other reverse_ff plugin; let's see the difference.
    Lolfaceftw is offline
    Mystik Spiral
    Senior Member
    Join Date: Oct 2020
    Location: Orlando, FL
    Old 12-08-2020 , 15:08   Re: [L4D2] Reverse Friendly-Fire [v1.1 (08-Dec-2020)]
    Reply With Quote #5

    Released v1.1...

    If attacker weapon has incendiary/explosive ammo, increase damage to attacker by 12.5%.

    I haven't yet figured out how to tell if the grenade launcher (projectile) has incendiary/explosive ammo, so there is no extra damage for that weapon yet. All other primary weapons should be working fine with higher damage when using special ammo. The special ammo extra damage is not a true reversal, but is a good compromise until/if I figure out how to directly reverse it.
    Mystik Spiral is offline
    user2000
    Member
    Join Date: Nov 2015
    Location: Peru - Lima
    Old 12-08-2020 , 18:42   Re: [L4D2] Reverse Friendly-Fire [v1.1 (08-Dec-2020)]
    Reply With Quote #6

    this plugin is perfect for me
    It would be possible to add a .cfg to activate or deactivate the immunity to the administrator or to control the weapon damage
    user2000 is offline
    Mystik Spiral
    Senior Member
    Join Date: Oct 2020
    Location: Orlando, FL
    Old 12-08-2020 , 18:56   Re: [L4D2] Reverse Friendly-Fire [v1.1 (08-Dec-2020)]
    Reply With Quote #7

    Quote:
    Originally Posted by user2000 View Post
    this plugin is perfect for me
    It would be possible to add a .cfg to activate or deactivate the immunity to the administrator or to control the weapon damage
    It might be a while, but I would like to add some ConVars for that, and also to enable/disable the plugin. And as I mentioned in the last post, I also want to reverse damage for grenade launcher projectiles.
    Mystik Spiral is offline
    Mystik Spiral
    Senior Member
    Join Date: Oct 2020
    Location: Orlando, FL
    Old 12-09-2020 , 08:01   Re: [L4D2] Reverse Friendly-Fire [v1.2 (09-Dec-2020)]
    Reply With Quote #8

    I was able to get to this sooner than expected and released version 1.2...

    Code:
    Added dynamically changeable ConVars:
    
      reverseff_enabled:  	set to 1 to enable plugin, 0 to disable
      reverseff_immunity:  	set to 1 to make admins immune to reverse FF damage, set to 0 to reverse FF damage for everyone
      reverseff_multiplier: if attacker is using explosive or incendiary ammo, increase damage by this multiplier
    			default is 1.125 (12.5% extra damage), 1.0=no extra damage, 2.0=double damage
    
    Also added a standard ConVar:
    
      reverseff_version: 	shows the plugin version
    If you are a server admin, and you have the admin system active on your client, you can change these ConVars during the middle of a game. For example, bring up a chat window and type...

    !cvar reverseff_immunity 0

    ...to instantly make everyone, including admins, take reverse friendly-fire damage. Another example...

    !cvar reverseff_multiplier 1.25

    ...to instantly make explosive/incendiary ammo do 25% more damage to the attacker than regular ammo.

    Of course, the changes are not permanent. To make your changes permanent, edit the values in the cfg/sourcemod/l4d_reverse_ff.cfg file.

    Last edited by Mystik Spiral; 12-09-2020 at 08:52. Reason: add examples
    Mystik Spiral is offline
    user2000
    Member
    Join Date: Nov 2015
    Location: Peru - Lima
    Old 12-09-2020 , 17:36   Re: [L4D2] Reverse Friendly-Fire [v1.2 (09-Dec-2020)]
    Reply With Quote #9

    thanks for updating the plugin
    user2000 is offline
    Mystik Spiral
    Senior Member
    Join Date: Oct 2020
    Location: Orlando, FL
    Old 12-13-2020 , 18:12   Re: [L4D2] Reverse Friendly-Fire [v1.3 (13-Dec-2020)]
    Reply With Quote #10

    New version 1.3 released, see original post for download.

    Added new ConVar "reverseff_bot" to determine if friendly-fire against bots should have damage reversed. Default is no. I created this option because bots often move in unpredictable and stupid ways, including walking into your line of fire even when you are crouched and not moving. With the default value, only attacks against human victims will reverse damage.

    The plugin now also detects when the grenade launcher has incendiary ammo and deals the appropriate (reverseff_multiplier) extra damage for it. Explosive ammo for the grenade launcher is not checked, because in my tests, there was no difference in the amount of damage between regular explosive ammo and explosive explosive ammo. I think that explosive explosive ammo for the grenade launcher may just expand the kill/stumble zone, but I'm not sure about that.

    If you have an older version of the plugin installed, you will need to add an entry to the "l4d_reverse_ff.cfg file to use the new ConVar, but I recommend you just delete the cfg file and let the plugin create a new one for you.

    Last edited by Mystik Spiral; 12-13-2020 at 18:14.
    Mystik Spiral 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 15:20.


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