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

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?
__________________
Accepting private work.

myGaming unique coded versus no VIP no premium.
eyal282 is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Brexit
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"
__________________
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.
__________________
My Site
My Public Plugins
Donate Me
Contact Me:
Steam: S4muRaY'
Taking Private Requests
Develop SourcePawn, HTML, PHP
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 online now
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 03:19.


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