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

[L4D2] How to change damage headshot SI


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hoanganh81097
Senior Member
Join Date: Apr 2016
Old 11-26-2018 , 20:12   [L4D2] How to change damage headshot SI
Reply With Quote #1

As a topic, how to change damage headshot SI ? Thank you very much
hoanganh81097 is offline
timtam95
Member
Join Date: Feb 2018
Old 11-27-2018 , 06:50   Re: [L4D2] How to change damage headshot SI
Reply With Quote #2

Quote:
Originally Posted by hoanganh81097 View Post
As a topic, how to change damage headshot SI ? Thank you very much
hook infected_hurt, check for a headshot then modify damage from there. i can help you if you want.

Last edited by timtam95; 11-27-2018 at 07:08.
timtam95 is offline
hoanganh81097
Senior Member
Join Date: Apr 2016
Old 11-27-2018 , 10:28   Re: [L4D2] How to change damage headshot SI
Reply With Quote #3

Quote:
Originally Posted by timtam95 View Post
hook infected_hurt, check for a headshot then modify damage from there. i can help you if you want.
can you help me write plugin ? please
hoanganh81097 is offline
timtam95
Member
Join Date: Feb 2018
Old 11-27-2018 , 21:13   Re: [L4D2] How to change damage headshot SI
Reply With Quote #4

Quote:
Originally Posted by hoanganh81097 View Post
can you help me write plugin ? please
Credits and thanks for code snippets go to alcybery and eyal282
https://forums.alliedmods.net/showthread.php?t=308401

and AtomicStryker
https://forums.alliedmods.net/showthread.php?p=1066911

Change cvar 'cv_hsdmg' to a float, e.g. 2 for 200% multiplier, .5 for 50% multiplier, etc.

This hasn't been thoroughly tested so let me know if you run into issues.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2SIHeadshotDMG.sp - 252 views - 5.8 KB)
File Type: smx l4d2SIHeadshotDMG.smx (8.3 KB, 80 views)
timtam95 is offline
hoanganh81097
Senior Member
Join Date: Apr 2016
Old 11-27-2018 , 22:05   Re: [L4D2] How to change damage headshot SI
Reply With Quote #5

Quote:
Originally Posted by timtam95 View Post
Credits and thanks for code snippets go to alcybery and eyal282
https://forums.alliedmods.net/showthread.php?t=308401

and AtomicStryker
https://forums.alliedmods.net/showthread.php?p=1066911

Change cvar 'cv_hsdmg' to a float, e.g. 2 for 200% multiplier, .5 for 50% multiplier, etc.

This hasn't been thoroughly tested so let me know if you run into issues.
Thanks for your help. This work for all weapons except All Snipers Weapon. Ex : awm, sniper_military, ... Still headshot one hit SI. Damage for all snipers <100. SI health 350.

Last edited by hoanganh81097; 11-27-2018 at 22:07.
hoanganh81097 is offline
shady_vn
New Member
Join Date: Nov 2018
Old 11-28-2018 , 09:56   Re: [L4D2] How to change damage headshot SI
Reply With Quote #6

Hi cass! cua Cass ne
Attached Files
File Type: smx headshot_damage.smx (4.3 KB, 81 views)
File Type: sp Get Plugin or Get Source (headshot_damage.sp - 230 views - 3.1 KB)
shady_vn is offline
Sout12
Member
Join Date: May 2017
Old 01-16-2021 , 05:09   Re: [L4D2] How to change damage headshot SI
Reply With Quote #7

I know this is old, but anyone know the cause for this error?

L 01/10/2021 - 03:56:52: [SM] Exception reported: Entity -1 (-1) is invalid
L 01/10/2021 - 03:56:52: [SM] Blaming: headshot_damage.smx
Sout12 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-17-2021 , 21:13   Re: [L4D2] How to change damage headshot SI
Reply With Quote #8

You didn't paste the full log, there are some missing lines that shows which line thrown the error. (usually above the [SM] Blaming... line)
__________________

Last edited by Marttt; 01-17-2021 at 21:13.
Marttt is offline
Sout12
Member
Join Date: May 2017
Old 01-21-2021 , 09:14   Re: [L4D2] How to change damage headshot SI
Reply With Quote #9

Quote:
Originally Posted by Marttt View Post
You didn't paste the full log, there are some missing lines that shows which line thrown the error. (usually above the [SM] Blaming... line)
I am sorry, I now got the full log

L 01/20/2021 - 02:192: [SM] Blaming: headshot_damage.smx
L 01/20/2021 - 02:192: [SM] Call stack trace:
L 01/20/2021 - 02:192: [SM] [0] GetEntPropString
L 01/20/2021 - 02:192: [SM] [1] Line 758, C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\inclu de\entity.inc::GetEntityClassname
L 01/20/2021 - 02:192: [SM] [2] Line 63, C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\heads hot_damage.sp::OnTakeDamage_SI
L 01/20/2021 - 02:195: [SM] Exception reported: Entity -1 (-1) is invalid
Sout12 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-21-2021 , 10:32   Re: [L4D2] How to change damage headshot SI
Reply With Quote #10

Try this one attached.

Btw the code seems to have some bugs if you use it on versus.
For coop-campaign should be fine.
Attached Files
File Type: sp Get Plugin or Get Source (headshot_damage.sp - 162 views - 3.1 KB)
__________________
Marttt 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 13:31.


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