ItsMods

Full Version: OnPlayerDamaged
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

i have a problem with OnPlayerDamaged.
When i use explosive weapons (launchers, grenades, etc.) and hit a enemy with it the OnPlayerDamaged method is called, but the Attacker is always the Victim.

Here an example (Deviler and Maximalus are each a Client):

1. Deviler shoots with RPG at Maximalus
2. Maximalus is about to get Damage -> OnPlayerDamaged is called
3. Problem in OnPlayerDamaged: The Attacker.Name and Victim.Name are both Maximalus

Is this suppose to happen? Or is this a mistake in the Addon?
Or is it just impossible to detect the person who shot/threw the missile/grenade because of the timespan between shooting and impact/explosion?

P.s.: I tested both impact and explosion and the damagemod differs but the end result is the same.
I never had that bug...
Can you show the code you writted in OnPlayerDamaged?
Are other plugins enabled on your server? which one?

(Teknogod version?)
I don't know,but I think it's a client ID problem...
CSHARP Code
  1. public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage, string DamageMod, HitLocations HitLocation)
  2. {
  3. //this is just for testing
  4. ServerSay("^1" + Attacker.Name + "^5 (^1ID^5=^1" + Attacker.ClientNum + "^5) hits ^1" + Victim.Name + "^5 (^1ID^5=^1" + Victim.ClientNum + "^5) with ^1" + Weapon + "^5 (^4ID^5=^4" + GetWeapon(Weapon) + "^5).", true);
  5. ServerSay("^5The DamageMod is ^4" + DamageMod + "^5. And the HitLocation is ^4" + HitLocation.ToString() + "^5.", true);
  6.  
  7. if (Attacker.ClientNum != Victim.ClientNum)
  8. {
  9. // Do what i want to do
  10. }
  11. return Damage;
  12. }

As you can see there is no problem in my OnPlayerDamaged Method.
Damage dealt with all other weapons are working as they should.
It must be a Server Addon problem.

No Teknogod, no other Plugin.
I tested with a smal plugin to show damage like you did, if i'm victim of a player's flash grenade it tell me that i damage myself....
So i also think there is an addon problem.

Someone else experience problems with this?

Infos:
Win 7 64
last released addon's version
(08-11-2012, 17:03)narkos Wrote: [ -> ]I tested with a smal plugin to show damage like you did, if i'm victim of a player's flash grenade it tell me that i damage myself....
So i also think there is an addon problem.

Someone else experience problems with this?

Infos:
Win 7 64
last released addon's version

zxz0O0 already answered indirectly in the MW3 Server Addon Thread.
I think he'll look into this but his first answer was that he is unsure if that problem can be fixed. So let's just wait and see