I need SHOWDAMAGE

chaochaoq9

Member
Member
Jul 27, 2014
102
4
16
Someone can do it? like Oxide, show damage is awesome
Code:
////KillMessages
//By ABC

function On_PlayerHurt(HurtEvent)
        {
        
                var a = HurtEvent.DamageAmount ;
                var b = HurtEvent.Attacker.Name ;

         if ( b == "MutantWolf")
            {
                 if ( a>10 &&  a<100) {

                HurtEvent.Victim.Message("你被[color#FF0000]变异狼[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

                }

    }
        else if ( b == "Wolf")
            {
                if ( a>10 &&  a<100) {

                HurtEvent.Victim.Message("你被[color#FF0000]狼[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

                }

    }

        else if ( b == "MutantBear")
            {
                if ( a>10 &&  a<100 ) {

                HurtEvent.Victim.Message("你被[color#FF0000]变异熊[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

                }

    }
        else if ( b == "Bear")
            {
                if ( a>10 &&  a<100 ) {

                HurtEvent.Victim.Message("你被[color#FF0000]熊[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

                }

    }
        else if ( a>10 &&  a<100 ){

                HurtEvent.Victim.Message("你被[color#FF0000]" + b + "[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

        }


}


I'll JS, but it seems there is an error, I can not complete.
 
Last edited:

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Code:
//KillMessages
//By ABC

function On_PlayerHurt(HurtEvent)
        {
         
                var a = HurtEvent.DamageAmount ;
                var b = HurtEvent.Attacker.Name ;

         if ( b == "MutantWolf")
            {
                 if ( a>10 &&  a<100) {

                HurtEvent.Victim.Message("你被[color#FF0000]变异狼[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

                }

    }
        else if ( b == "Wolf")
            {
                if ( a>10 &&  a<100) {

                HurtEvent.Victim.Message("你被[color#FF0000]狼[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

                }

    }

        else if ( b == "MutantBear")
            {
                if ( a>10 &&  a<100 ) {

                HurtEvent.Victim.Message("你被[color#FF0000]变异熊[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

                }

    }
        else if ( b == "Bear")
            {
                if ( a>10 &&  a<100 ) {

                HurtEvent.Victim.Message("你被[color#FF0000]熊[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

                }

    }
        else if ( a>10 &&  a<100 ){

                HurtEvent.Victim.Message("你被[color#FF0000]" + b + "[/color]攻击,损失[color#FF0000]  -" + Math.round(a)  +"[/color] HP");

        }


}


I'll JS, but it seems there is an error, I can not complete.
Whats the error?
 

chaochaoq9

Member
Member
Jul 27, 2014
102
4
16
Copy paste error..
Code:
//KillMessages
//By Vecrox

function On_PlayerHurt(HurtEvent)
        {  
        if(HurtEvent.DamageAmount>1 &&  HurtEvent.DamageAmount<100)
                {
                    HurtEvent.Victim.Message("Was attacked -"+ Math.round.HurtEvent.DamageAmount+" HP!");
                }
        }
Original code . I modified the code, some of the issues a bit more difficult for me.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Code:
//KillMessages
//By Vecrox

function On_PlayerHurt(HurtEvent)
        { 
        if(HurtEvent.DamageAmount>1 &&  HurtEvent.DamageAmount<100)
                {
                    HurtEvent.Victim.Message("Was attacked -"+ Math.round.HurtEvent.DamageAmount+" HP!");
                }
        }
Original code . I modified the code, some of the issues a bit more difficult for me.
That's not the error...
 

Chaotics

New Member
Member
Aug 3, 2015
4
0
1
28
DreTaX, can you help me with some plugins? i lost my night working on my server but some plugins can't work :/