public override void PerformKill(object sender, KillEvent killEvent) { if (!player.CanMove) { return; } if (player.Data.IsDead) { return; } if (SheriffKillTimer() != 0f) { return; } Role target = GetClosestPlayer(); float dist = (float)GetDistanceTo(this, target); if (dist < (double)GameOptionsData.KillDistances[PlayerControl.GameOptions.KillDistance]) { bool hasKilled = false; if (target.roleInfo.type == RoleTypes.Crewmate && Sheriff.sheriffKillOther.GetValue()) { hasKilled = KillManager.AttemptMurder(this, target); if (hasKilled) { KillManager.Suicide(this); } } else { hasKilled = KillManager.AttemptMurder(this, target); } killEvent.Consume(true); return; } }
public override void Handle(PlayerControl innerNetObject, Data data) { PluginSingleton <FloofUsPlugin> .Instance.Log.LogInfo("Handling CustomKill Rpc"); KillManager.MurderPlayer(data.Killer, data.Target); }