Raised This Month: $ Target: $400
 0% 

Mirror Damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
tm.
Member
Join Date: Apr 2010
Old 05-20-2010 , 09:01   Re: Mirror Damage
Reply With Quote #7

I hope this isn't interpreted as a bump, but I already stated in the post above that the problem was solved and just now realized that it's not, so nobody would'd noticed an edit.

So it's not possible to block the damage taken by the victim with HAM_SUPERCEDE and in the same time to get the correct damage (if victim has armor) so I could pass it to the attacker? Cause I tried something like this
PHP Code:
      RegisterHam(Ham_TakeDamage"player""fw_Damage"1)
}

public 
fw_Damage(victimattacker)
{
      if(
get_user_team(victim) == get_user_team(attacker) && victim != attacker && is_user_alive(attacker))
    {
        new 
iDamage pev(victimpev_dmg_take)

        new 
hp get_user_health(attacker) - iDamage

        
if(hp 0)
            
set_user_health(attackerhp)

        else
            
user_kill(attacker)

        new 
vName[32]
        
get_user_name(victimvName31)
        
client_print(attackerprint_chat"[AMXX] You team attacked %s and lost %d hp"vNameiDamage)
    }

    return 
HAM_SUPERCEDE

and it's obviously that it won't work.
And what's the thing with the inflictor param? I've tested it and notice that is 0 when not attacked by a player, 1...2 (i can test it only with two players so I guess it's the attacker's id, and 116 or 128 or other values maybe if the damage was made by a he grenade. If I'm right it's a safe way to detect he damage?
tm. is offline
 



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:54.


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