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

ExecuteHam TakeDamage always hit in the head


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 04-05-2019 , 15:54   ExecuteHam TakeDamage always hit in the head
Reply With Quote #1

When I do ExecuteHam(Ham_TakeDamage, victim, id, id, amount, DMG_BULLET), the damage is always in the head and player gets slowed down.

How to change this? I want the user to just lose HP.
Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
E1_531G
Senior Member
Join Date: Dec 2017
Old 04-05-2019 , 16:16   Re: ExecuteHam TakeDamage always hit in the head
Reply With Quote #2

Quote:
Originally Posted by Desikac View Post
When I do ExecuteHam(Ham_TakeDamage, victim, id, id, amount, DMG_BULLET), the damage is always in the head and player gets slowed down.
How did you figured it out?

Just substract HP with set_user_health() and add effects (sound, damage, shake, fade,...) if you need any.
__________________
My English is A0
E1_531G is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-08-2019 , 05:44   Re: ExecuteHam TakeDamage always hit in the head
Reply With Quote #3

You can change m_LastHitGroup using set_pdata_int or (in 1.9.0) set_ent_data before calling TakeDamage. If you just call TakeDamage like that it will be as if it hit wherever the previous actual hit registered.
Also, in case you can do it (if you have a proper trace handle), better call TraceAttack instead of TakeDamage
__________________
klippy 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 21:53.


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