[L4D2]How to get the hit group in SDKHook_OnTakDamage?
I want to modify the damage base on the hit group, but it seem no way to get it except event "player_hurt".
As far as i know, event is too late to change the damage. Use SDKHook_TakeDamage looks not good because it cause the other damage of one shot. |
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
use SDKHook_TraceAttack
PHP Code:
|
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
got it, i will try this hook tonight.
|
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
You can use also the event player_hurt but is kinda the last event, if you need modify something then goes for TraceAttack/TakeDamage
|
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
before trigging OnTakeDamage, TraceAttack definitely trigger before.
you can check my [L4D & L4D2] Limb-Based Damage Modifier, if you want modify on OnTakeDamageAlive (if you just want multiply use TraceAttack only ) just made global variable like https://forums.alliedmods.net/showthread.php?p=2777880 |
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
thanks reply, i use TraceAttack and it works well.
By the way, do you know how to detect a player is shoved? I try to use l4d_OnStagger() but it not work. Left4dhook has another way which use CTerrorWeapon::OnHIt , but it seems too expensive. |
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
Don't know for what use it is for, but you can try using the events below:
|
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
yes, i just want to check it in this SDKHook to modify the damage...
PHP Code:
Do you have some suggestion? |
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
Maybe is better to check damagetype
AFAIK shove is always DMG_CLUB and a valid client index for inflictor. unless you have some plugin or addon that changes that. |
Re: [L4D2]How to get the hit group in SDKHook_OnTakDamage?
Quote:
PHP Code:
|
All times are GMT -4. The time now is 00:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.