AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Hook damage that will kill the player (https://forums.alliedmods.net/showthread.php?t=307638)

eyal282 05-19-2018 17:04

Hook damage that will kill the player
 
I want to hook damage event that will kill the player, and block the damage. Should I use SDKHooks_TakeDamage?

Lux 05-19-2018 17:33

Re: Hook damage that will kill the player
 
Yes use SDKHooks
Use the hook "SDKHooks_OnTakeDamage"

BraveFox 05-20-2018 06:08

Re: Hook damage that will kill the player
 
Use sdkhook ontakedamage and check if the damage is bigger or equal to the player's health.

Neuro Toxin 05-20-2018 08:16

Re: Hook damage that will kill the player
 
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.


All times are GMT -4. The time now is 03:30.

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