Raised This Month: $32 Target: $400
 8% 

Cancelling a player hurt event


Post New Thread Reply   
 
Thread Tools Display Modes
stephen473
Senior Member
Join Date: Jan 2017
Location: somewhere on earth
Old 06-25-2017 , 05:26   Re: Cancelling a player hurt event
Reply With Quote #11

return Plugin_Handled
__________________
Also known as Hardy`.

Feel free to contact me if you have a private plugin request!

My Steam Profile | Discord: Hardy`#3792
stephen473 is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-25-2017 , 09:29   Re: Cancelling a player hurt event
Reply With Quote #12

Quote:
Originally Posted by Neuro Toxin View Post
You should hook SDKHook_OnTakeDamageAlive to properly cancel damage.
doesn't OnTakeDamageAlive get called by OnTakeDamage?
__________________
WildCard65 is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 06-25-2017 , 14:05   Re: Cancelling a player hurt event
Reply With Quote #13

From last time i played with SDKHooks, sending return Plugin_Handled to OnTakeDamageAlive crashed my server while OnTakeDamage didn't.

Otherwise i would use OnTakeDamageAlive to change final damages like TF2 critical hits, i guess you could also set damage to 0.0 and return Plugin_Changed on OnTakeDamageAlive as well.
__________________
Chaosxk is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-26-2017 , 18:27   Re: Cancelling a player hurt event
Reply With Quote #14

Quote:
Originally Posted by WildCard65 View Post
doesn't OnTakeDamageAlive get called by OnTakeDamage?
No, it gets called later, after any damage adjustments take place... such as armor reducing damage or critical hits increasing damage.
__________________
Not currently working on SourceMod plugin development.
Powerlord 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 06:27.


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