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

Hook damage that will kill the player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 05-19-2018 , 17:04   Hook damage that will kill the player
Reply With Quote #1

I want to hook damage event that will kill the player, and block the damage. Should I use SDKHooks_TakeDamage?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 05-19-2018 , 17:33   Re: Hook damage that will kill the player
Reply With Quote #2

Yes use SDKHooks
Use the hook "SDKHooks_OnTakeDamage"
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 05-20-2018 , 06:08   Re: Hook damage that will kill the player
Reply With Quote #3

Use sdkhook ontakedamage and check if the damage is bigger or equal to the player's health.
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-20-2018 , 08:16   Re: Hook damage that will kill the player
Reply With Quote #4

You should use the SDKHooks_OnTakeDamage_Alive hook for this

The player is still alive during this hook. Just check the players health netprop and compare to the damage parameter in the hook.

Here is an example of the hook.
__________________

Last edited by Neuro Toxin; 05-20-2018 at 08:18.
Neuro Toxin 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 07:22.


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