From c82a58f5ab4c532981b8fe64c31c4c98ece4a575 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 26 Jul 2024 14:47:18 +1000 Subject: [PATCH] feat: update game events (adds `bullet_damage` event) --- .../Core/GameEvents.g.cs | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/managed/CounterStrikeSharp.API/Core/GameEvents.g.cs b/managed/CounterStrikeSharp.API/Core/GameEvents.g.cs index 361cddf57..0f961e780 100644 --- a/managed/CounterStrikeSharp.API/Core/GameEvents.g.cs +++ b/managed/CounterStrikeSharp.API/Core/GameEvents.g.cs @@ -716,6 +716,86 @@ public int Material } } + [EventName("bullet_damage")] + public class EventBulletDamage : GameEvent + { + public EventBulletDamage(IntPtr pointer) : base(pointer){} + public EventBulletDamage(bool force) : base("bullet_damage", force){} + + + + // player index who was hurt + public CCSPlayerController? Victim + { + get => GetPlayer("victim"); + set => SetPlayer("victim", value); + } + + + // player index who attacked + public CCSPlayerController? Attacker + { + get => GetPlayer("attacker"); + set => SetPlayer("attacker", value); + } + + + // how far the bullet travelled before it hit the player + public float Distance + { + get => Get("distance"); + set => Set("distance", value); + } + + + // direction vector of the bullet + public float DamageDirX + { + get => Get("damage_dir_x"); + set => Set("damage_dir_x", value); + } + + + // direction vector of the bullet + public float DamageDirY + { + get => Get("damage_dir_y"); + set => Set("damage_dir_y", value); + } + + + // direction vector of the bullet + public float DamageDirZ + { + get => Get("damage_dir_z"); + set => Set("damage_dir_z", value); + } + + + // how many surfaces were penetrated + public int NumPenetrations + { + get => Get("num_penetrations"); + set => Set("num_penetrations", value); + } + + + // was the shooter noscoped? + public bool NoScope + { + get => Get("no_scope"); + set => Set("no_scope", value); + } + + + // was the shooter jumping? + public bool InAir + { + get => Get("in_air"); + set => Set("in_air", value); + } + } + [EventName("bullet_flight_resolution")] public class EventBulletFlightResolution : GameEvent {