Named in the code or data of server.
PlayerHurtEvent[GameEventHandler("player_hurt")]
public HookResult OnPlayerHurt(PlayerHurtEvent args) {
// args.UseridController, args.UseridPawn, args.AttackerController, args.AttackerPawn,
// args.Attackerentid, args.Health, args.Armor, args.Weapon, args.DmgHealth, args.DmgArmor,
// args.Hitgroup, args.Type
return HookResult.Continue;
}| Field | Type | Deadworks property | Valve's comment |
| userid | player_controller_and_pawn | UseridController CBasePlayerController? UseridPawn CBasePlayerPawn? | user ID who was hurt |
| attacker | player_controller_and_pawn | AttackerController CBasePlayerController? AttackerPawn CBasePlayerPawn? | user id who attacked |
| attackerentid | long | Attackerentid int | entity id who attacked, if attacker not a player, and userid therefore invalid |
| health | short | Health int | remaining health points |
| armor | byte | Armor int | remaining armor points |
| weapon | string | Weapon string | weapon name attacker used, if not the world |
| dmg_health | short | DmgHealth int | damage done to health |
| dmg_armor | byte | DmgArmor int | damage done to armor |
| hitgroup | byte | Hitgroup int | hitgroup that was damaged |
| type | long | Type int | damage type |