Resource icon

Approved DamageDisplay 1.0

No permission to download

Assassin

Plugin Developer
Plugin Developer
Apr 9, 2017
190
196
43
26
Iran
I need to do some edit here:

Python:
def On_PlayerHurt(self, HurtEvent):
        if HurtEvent.Attacker is None or HurtEvent.Victim is None:
            return
        if HurtEvent.AttackerIsPlayer and HurtEvent.VictimIsPlayer:
            if Notice:
                HurtEvent.Attacker.Notice("Remaining Health: " + str(HurtEvent.Victim.Health))
            else:
                HurtEvent.Attacker.MessageFrom(sys, "Remaining Health: " + str(HurtEvent.Victim.Health))
I want to change it to
Python:
HurtEvent.Attacker.Notice("Damage Dealt To victim:(HurtEvent.DamageAmount)")
but i recive Syntax Eror -_-!
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Python:
HurtEvent.Attacker.Notice("Damage Dealt To victim: "
+ str(HurtEvent.DamageAmount))
But I would word it like this:
Python:
HurtEvent.Attacker.Notice("Dealt: " +  str(HurtEvent.DamageAmount + " to Victim")
 
  • Like
Reactions: Assassin

Assassin

Plugin Developer
Plugin Developer
Apr 9, 2017
190
196
43
26
Iran
Python:
HurtEvent.Attacker.Notice("Damage Dealt To victim: "
+ str(HurtEvent.DamageAmount))
But I would word it like this:
Python:
HurtEvent.Attacker.Notice("Dealt: " +  str(HurtEvent.DamageAmount + " to Victim")
First code works good!but there is a problems!victim or Victim in the server shows as victim/Victim!but i think it must to be Player Name!
i tried to fix it but every time SyntaxEror is my answer :|
Second code has a SyntaxEror and i think that is here

Python:
str(HurtEvent.DamageAmount + " to Victim")
i think you must change it to
Python:
str(HurtEvent.DamageAmount) + " to Victim")
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
First code works good!but there is a problems!victim or Victim in the server shows as victim/Victim!but i think it must to be Player Name!
i tried to fix it but every time SyntaxEror is my answer :|
Second code has a SyntaxEror and i think that is here

Python:
str(HurtEvent.DamageAmount + " to Victim")
i think you must change it to
Python:
str(HurtEvent.DamageAmount) + " to Victim")
ohh, You want their name!!
Python:
HurtEvent.Attacker.Notice(str(HurtEvent.DamageAmount) + " Dealt To " + HurtEvent.Victim.Name + ": ")
But I would word it like this:
Python:
HurtEvent.Attacker.Notice("Dealt: " +  str(HurtEvent.DamageAmount + " to " + HurtEvent.Victim.Name)
 
  • Useful
Reactions: Assassin