private void OnKilled(BasePlayer attacker, BasePlayer victim, HitInfo hitInfo, int dist) { if (_config.EnableChatFeed) { if (!_data.DisabledUsers.Contains(attacker.userID)) { Player.Message(attacker, _("MsgAttacker", attacker), null, _config.IconId, victim.displayName, dist, hitInfo.boneArea); } if (!_data.DisabledUsers.Contains(victim.userID)) { Player.Message(victim, _("MsgVictim", victim), null, _config.IconId, attacker.displayName, dist, GetCustomWeaponName(hitInfo), hitInfo.boneArea); } } _killQueue.OnDeath(victim, attacker, string.Format(_("MsgFeedKill"), SanitizeName(attacker.displayName), SanitizeName(victim.displayName), GetCustomWeaponName(hitInfo), hitInfo.boneArea, GetDistanceColor(dist), dist)); }
private void OnKilled(BasePlayer attacker, BasePlayer victim, HitInfo hitInfo, int dist) { if (attacker.IsNpc) { if (!_config.EnableNpcFeed) { return; } var npc = attacker; _killQueue.OnDeath(victim, null, string.Format(_("MsgFeedKillNpc"), CustomNpcName(npc), SanitizeName(GetClan(victim) + victim.displayName), GetDistanceColor(dist), dist)); return; } if (victim.IsNpc) { if (!_config.EnableNpcFeed) { return; } var npc = victim; _killQueue.OnDeath(attacker, null, string.Format(_("MsgFeedKill"), SanitizeName(GetClan(attacker) + attacker.displayName), CustomNpcName(npc), GetCustomWeaponName(hitInfo), hitInfo.boneArea, GetDistanceColor(dist), dist)); return; } if (_config.EnableChatFeed) { if (!_data.DisabledUsers.Contains(attacker.userID)) { Player.Message(attacker, _("MsgAttacker", attacker), null, _config.IconId, GetClan(victim) + victim.displayName, dist, hitInfo.boneArea); } if (!_data.DisabledUsers.Contains(victim.userID)) { Player.Message(victim, _("MsgVictim", victim), null, _config.IconId, GetClan(attacker) + attacker.displayName, dist, GetCustomWeaponName(hitInfo), hitInfo.boneArea); } } _killQueue.OnDeath(victim, attacker, string.Format(_("MsgFeedKill"), SanitizeName(GetClan(attacker) + attacker.displayName), SanitizeName(GetClan(victim) + victim.displayName), GetCustomWeaponName(hitInfo), hitInfo.boneArea, GetDistanceColor(dist), dist)); if (!_config.EnableLogging) { return; } var sfkLog = new StringBuilder($"{DateTime.Now}: ({attacker.UserIDString}){attacker.displayName} killed ({victim.UserIDString}){victim.displayName} from {dist}m in {hitInfo.boneArea}"); LogToFile("SimpleKillFeed", sfkLog.ToString(), this); }