I'm doing a plugin for the customization of notification of death. But can't understand where i can get killer nick. Could not tell anything?
And sorry for my English)
Getting killer's name?
Discussion in 'Hurtworld Development' started by Crazy Hurtworld, Jan 25, 2016.
-
This should help you out Custom Death Messages for Hurtworld | Oxide
-
Unfortunately, did not help, but thank you
OnDeathNotice and OnPlayerDeath don't trigger when the player kills the player. With animals and other types of deaths, everything is fine, and the player-player does not work -
Okay assuming your variable for the EntityEffectSourceData is "source" (like it is in the Custom Death Messages)
You can use this to get the Killer name: GameManager.Instance.GetDescriptionKey(source.EntitySource)
But be aware that you will need to do .Replace("(P)",""); to remove the (P) they added to the names, if you are wanting to match the killers name with the actual player, as they will not match with the (P). -
Have a look at my bounty hunters plugin.
@Noviets
My approach of removing (P) was the following:
v
Code:ar tmpName = GetNameOfObject(source.EntitySource); if (tmpName.Length < 3) return; var murdererName = tmpName.Remove(tmpName.Length - 3); string GetNameOfObject(GameObject obj) { var ManagerInstance = GameManager.Instance; return ManagerInstance.GetDescriptionKey(obj); }
-