Skip to content

How can I get a characters name from an entity ID? #114

Closed Answered by saul
Theoya asked this question in Q&A
Discussion options

You must be logged in to vote

Please paste your code so we can help you.

You should be able to get all the information you need from the PlayerHurt Source1GameEvent:

demo.Source1GameEvents.PlayerDeath += e =>
{
    Console.WriteLine($"{e.Attacker?.PlayerName} [{e.Weapon}] {e.Player?.PlayerName}");
};

demo.Source1GameEvents.PlayerHurt += e =>
{
    var hitgroup = (HitGroup)e.Hitgroup;
    Console.WriteLine($"-> {e.Attacker?.PlayerName} hit {e.Player?.PlayerName} for {e.DmgHealth} dmg in {hitgroup} with {e.Weapon}");
};

enum HitGroup
{
    Generic = 0,
    Head = 1,
    Chest = 2,
    Stomach = 3,
    Leftarm = 4,
    Rightarm = 5,
    Leftleg = 6,
    Rightleg = 7,
    Neck = 8,
    Unused = 9,
    Gear = 10,
    Spe…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by saul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants