-
I'm trying to determine a players headshot% and am having trouble getting that data together. I'm trying to relate the entity from BulletImpact to a player id but they don't match up, and PlayerSpawn isn't firing so i'm unable to get the id's from there |
Beta Was this translation helpful? Give feedback.
Answered by
saul
Oct 8, 2024
Replies: 1 comment
-
Please paste your code so we can help you. You should be able to get all the information you need from the 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,
Special = 11,
}; Some example output:
Let me know if this doesn't solve your problem |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
saul
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please paste your code so we can help you.
You should be able to get all the information you need from the
PlayerHurt
Source1GameEvent: