Raised This Month: $ Target: $400
 0% 

[L4d2] Damage dealt to Special Infected


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lightphoenix2
Member
Join Date: Feb 2016
Old 07-10-2021 , 03:31   [L4d2] Damage dealt to Special Infected
Reply With Quote #1

Hi,

I would appreciate it if someone could take a look at this.
I run a server with more than 4 players.
This plugins detect damage done to special infected using the method 'public Action OnTakeDamage' in line 270.
Sometimes the damage dealt to the special infected is incorrect.

Can someone take a look at correct/improve this?

Thanks

[Edit]
I have another plugin that modifies the damage dealt.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_skills_core_V2.2.sp - 48 views - 40.6 KB)
File Type: sp Get Plugin or Get Source (l4d2_critical_shot_m.sp - 47 views - 7.8 KB)

Last edited by lightphoenix2; 07-10-2021 at 06:50.
lightphoenix2 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-10-2021 , 10:31   Re: [L4d2] Damage dealt to Special Infected
Reply With Quote #2

You could try hooking 'player_hurt' instead.

OnTakeDamage may return inaccurate results cause after that,
It applied some game formulas or other plugins behaviours.

e.g: if you have 2 plugins and one changes the damage dealt on "OnTakeDamage" there is no guarantee that your plugin that detects the damage will run after the other that changes the damage dealt.

May not be exactly what I said but is what I already noticed sometimes.
__________________

Last edited by Marttt; 07-10-2021 at 10:43.
Marttt is offline
lightphoenix2
Member
Join Date: Feb 2016
Old 07-10-2021 , 16:11   Re: [L4d2] Damage dealt to Special Infected
Reply With Quote #3

Quote:
Originally Posted by Marttt View Post
You could try hooking 'player_hurt' instead.

OnTakeDamage may return inaccurate results cause after that,
It applied some game formulas or other plugins behaviours.

e.g: if you have 2 plugins and one changes the damage dealt on "OnTakeDamage" there is no guarantee that your plugin that detects the damage will run after the other that changes the damage dealt.

May not be exactly what I said but is what I already noticed sometimes.
I see, I could try and see if it make any difference.
I want to see the actual damage done after other plugins behaviours.

Sometimes the damage done is credited to the wrong player or what I believed is that it credited the killing player with the most damage. Its quite strange.

Thanks for your feedback, really appreciate it Marttt.
lightphoenix2 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-10-2021 , 16:42   Re: [L4d2] Damage dealt to Special Infected
Reply With Quote #4

Use the "SDKHook_OnTakeDamageAlive" hook, if not using already (haven't seen source)
__________________
Silvers is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-10-2021 , 18:52   Re: [L4d2] Damage dealt to Special Infected
Reply With Quote #5

Dragokas made a similar thread some months ago, check his thread:

[L4D] How accurately calculate tank damage with SDKHook?
__________________
Marttt is offline
lightphoenix2
Member
Join Date: Feb 2016
Old 07-11-2021 , 04:43   Re: [L4d2] Damage dealt to Special Infected
Reply With Quote #6

Quote:
Originally Posted by Marttt View Post
Dragokas made a similar thread some months ago, check his thread:

[L4D] How accurately calculate tank damage with SDKHook?
This really helps a lot, I used what you suggested using event player hurt. It can detect damage done from plugins, which is great.

Quote:
Originally Posted by Silvers View Post
Use the "SDKHook_OnTakeDamageAlive" hook, if not using already (haven't seen source)
I never tried this before, I will look into this as well. Thanks Silvers.

Really helpful you guys
lightphoenix2 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 05:35.


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