Raised This Month: $51 Target: $400
 12% 

[L4D & L4D2] Common Infected Headshot Damage (1.1) [20-May-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
8052
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Prevents insta kill headshots and scales Headshot damage on Common Infected.
    Unapprover:
    Reason for Unapproving:
    Superceded by: https://forums.alliedmods.net/showthread.php?t=337806
    Old 05-16-2022 , 15:54   [L4D & L4D2] Common Infected Headshot Damage (1.1) [20-May-2022]
    Reply With Quote #1

    This plugin has been merged into: Common Infected Health - Damage Received. Please use that instead.
    __________________

    Last edited by Silvers; 05-27-2022 at 14:47.
    Silvers is offline
    Maur0
    Senior Member
    Join Date: Aug 2020
    Old 05-19-2022 , 15:26   Re: [L4D & L4D2] Common Infected Headshot Damage (1.0) [16-May-2022]
    Reply With Quote #2

    Nice plugin. One thing I would like to ask you, if possible. Add a command to separate between firearms with melee weapons.

    Since the idea would be to give it a factor of 0.5 and with melee weapons it is more difficult to kill the common with decapitation since they receive 4 hits. So prevent that from happening, allow or disallow melee weapons headshot damage. And so leave only the firearms.

    I hope you understand this and more than that.
    Maur0 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 05-20-2022 , 08:40   Re: [L4D & L4D2] Common Infected Headshot Damage (1.1) [20-May-2022]
    Reply With Quote #3

    Done.

    Code:
    1.1 (20-May-2022)
        - Added cvar "l4d_common_headshot_melee" to block applying damage to melee weapons. Requested by "Maur0".
    __________________
    Silvers is offline
    Maur0
    Senior Member
    Join Date: Aug 2020
    Old 05-20-2022 , 17:22   Re: [L4D & L4D2] Common Infected Headshot Damage (1.1) [20-May-2022]
    Reply With Quote #4

    Quote:
    Originally Posted by Silvers View Post
    Done.

    Code:
    1.1 (20-May-2022)
        - Added cvar "l4d_common_headshot_melee" to block applying damage to melee weapons. Requested by "Maur0".
    Thank you very much!
    Maur0 is offline
    Toranks
    Senior Member
    Join Date: Dec 2021
    Location: Spain
    Old 05-23-2022 , 01:45   Re: [L4D & L4D2] Common Infected Headshot Damage (1.1) [20-May-2022]
    Reply With Quote #5

    OBSOLETE

    Last edited by Toranks; 05-27-2022 at 15:47. Reason: Moved to commons health damage plugin by Silvers
    Toranks is offline
    Toranks
    Senior Member
    Join Date: Dec 2021
    Location: Spain
    Old 05-23-2022 , 04:30   Re: [L4D & L4D2] Common Infected Headshot Damage (1.1) [20-May-2022]
    Reply With Quote #6

    I have observed that you block the head wounds of some uncommons that actually do have them.
    In addition, you also completely remove wounds from ceda, jimmy and riot uncommons, which is also not necessary. The vanilla behavior is correct, as they will never lose their heads, only MALE and FEMALE gender can lose their heads, and replace them for the partially injured head is sufficient by itself.

    I have modified this code, together with the changes I've commented in your "Common Infected Health - Damage Received" plugin:

    Code:
    if( GetEntProp(victim, Prop_Data, "m_iHealth") - damage > 0.0 )
    		{
    			// Prevent headshot insta-death
    			SetEntProp(victim, Prop_Data, "m_LastHitGroup", 2);
    
    			bool wounds = true;
    
    			if( g_bLeft4Dead2 )
    			{
    				static char sTemp[48];
    				GetEntPropString(victim, Prop_Data, "m_ModelName", sTemp, sizeof(sTemp));
    
    				if( strcmp(sTemp, "models/infected/common_male_") == 0 &&
    					(
    					strcmp(sTemp[28], "ceda.mdl") == 0 ||
    					strcmp(sTemp[28], "jimmy.mdl") == 0 ||
    					strcmp(sTemp[28], "riot.mdl") == 0
    					)
    				)
    				{
    					wounds = false;
    				}
    			}
    
    			if( wounds == true )
    			{
    			// Change completely destroyed head gib to partial head gib with brains showing
    			if( GetEntProp(victim, Prop_Send, "m_iRequestedWound1") == 8 )
    				SetEntProp(victim, Prop_Send, "m_iRequestedWound1", 6);
    			if( GetEntProp(victim, Prop_Send, "m_iRequestedWound2") == 8 )
    					SetEntProp(victim, Prop_Send, "m_iRequestedWound2", 6);
    			}
    		}
    With this result. I love it!:

    Last edited by Toranks; 05-23-2022 at 10:10.
    Toranks is offline
    Reply



    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 04:10.


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