AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_user_hp by attacker damage (https://forums.alliedmods.net/showthread.php?t=216272)

ke3ller 05-18-2013 18:14

set_user_hp by attacker damage
 
I have no idea where to search the function code and I want to do a resistance option for that works only for 5 seconds.
I was thinking at sth like set_user_hp ( get_attacker_dmg + attacker dmg) but I don't know if it's possible, specialy only for 5 secs.
I found this code from EKS's Runemod but I can't undestand it or use it (is making the user resist to 50% of attack):

PHP Code:

#define RESIST_AMOUT 0.50

public API_Damage(victim,attacker,damage)
{
    if ( 
bla bla
    {
???
#endif??? 
            
return damage floatround(damage RESIST_AMOUT
    }
    return 
damage     



ConnorMcLeod 05-18-2013 19:02

Re: set_user_hp by attacker damage
 
Need to hook Ham_TakeDamage and to lower damage amount using HamSetParamFloat or SetHamParamFloat

SetHamParamFloat(4, damage * (1.0 - RESIST_AMOUT))


Btw, in which plugin do you want to include this ?


All times are GMT -4. The time now is 16:23.

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