Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnPlayerDamaged
#1
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.
Reply

#2
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?)
Reply

#3
I don't know,but I think it's a client ID problem...
Troll
Reply

#4
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.
Reply

#5
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
Reply

#6
(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
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] public override int OnPlayerDamaged() hitbox string or int DeathAngel1479 15 7,737 04-15-2012, 22:55
Last Post: OrangePL

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.