Raised This Month: $ Target: $400
 0% 

Mirror Damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
tm.
Member
Join Date: Apr 2010
Old 05-19-2010 , 12:46   Mirror Damage
Reply With Quote #1

Hi. I have this mirror damage plugin:
PHP Code:
#include <amxmodx>
#include <fun>

public plugin_init()
{
    
register_plugin("Mirror Damage""1.0.0""EKS")
    
register_event("Damage""Event_Damage""b""2!0""3=0""4!0")
}

public 
Event_Damage()
{
    new 
damage read_data(2)
    new 
victim read_data(0)
    new 
attacker get_user_attacker(victim)

    if(
get_user_team(victim) == get_user_team(attacker) && victim != attacker)
    {
        if (
is_user_alive(attacker))
        {
            new 
HP get_user_health(attacker) - damage

            
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"vNamedamage)
        }

        if (
is_user_alive(victim))
        {
            new 
HP get_user_health(victim) + damage
            set_user_health
(victimHP)
        }
    }

My question: is it possible to block victim's death if the damage inflicted to the victim is greater then the victim's hp?
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