AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TakeDamage event related question (https://forums.alliedmods.net/showthread.php?t=209781)

meTaLiCroSS 03-01-2013 21:13

TakeDamage event related question
 
When does the attacker == victim? Just was reading a public plugin and I saw this condition, and I didn't think when this happens also with a he-grenade...

jimaway 03-02-2013 10:28

Re: TakeDamage event related question
 
attacker == victim means the attacker did damage to himself (got damage from his own he grenade)

r0ck 03-02-2013 12:39

Re: TakeDamage event related question
 
I have tested in my plugin way back i also wondered the same but it works for He-Grenade ("ONLY" not sure)
but i have seen attacker==victim in many plugins in traceattack, though there is no effect of attacker == victim in traceattack..., It just in case of takedamage & he grenade damage it is usefull

ConnorMcLeod 03-02-2013 13:31

Re: TakeDamage event related question
 
Anyway, even if it is useless, it is a small check that doesn't use cpu so it is completely safe to use.
Also, you may consider that some plugins may send Ham_TraceAttack or TakeDamage with attacker == victim using ExecuteHamB, example (could use HamB) : mirror damage : https://forums.alliedmods.net/showpo...09&postcount=2

meTaLiCroSS 03-02-2013 14:23

Re: TakeDamage event related question
 
Quote:

Originally Posted by jimaway (Post 1905065)
attacker == victim means the attacker did damage to himself (got damage from his own he grenade)

You don't say?

Quote:

Originally Posted by r0ck (Post 1905139)
I have tested in my plugin way back i also wondered the same but it works for He-Grenade ("ONLY" not sure)
but i have seen attacker==victim in many plugins in traceattack, though there is no effect of attacker == victim in traceattack..., It just in case of takedamage & he grenade damage it is usefull

Quote:

Originally Posted by ConnorMcLeod (Post 1905191)
Anyway, even if it is useless, it is a small check that doesn't use cpu so it is completely safe to use.
Also, you may consider that some plugins may send Ham_TraceAttack or TakeDamage with attacker == victim using ExecuteHamB, example (could use HamB) : mirror damage : https://forums.alliedmods.net/showpo...09&postcount=2

I thought that... because, well, fall damage is done by a null entity, trigger_hurt is passed as inflictor and attacker, when selfkilling with kill command the Killed function is called directly, so that's why I was thinking "why this statement o.O" but "without having in care external plugins" just HE Grenade can validate this attacker == victim statement?

ConnorMcLeod 03-02-2013 15:50

Re: TakeDamage event related question
 
Quote:

Originally Posted by meTaLiCroSS (Post 1905223)
but "without having in care external plugins" just HE Grenade can validate this attacker == victim statement?

Yes, jimaway already wrote it.

meTaLiCroSS 03-02-2013 20:38

Re: TakeDamage event related question
 
Quote:

Originally Posted by ConnorMcLeod (Post 1905287)
Yes, jimaway already wrote it.

Ok, thanks again n_n


All times are GMT -4. The time now is 21:38.

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