コード例 #1
0
        public void OnPlayerHurt(HurtingEventArgs ev)
        {
            if (ev.Amount >= ev.Target.Health)
            {
                string kosinfo      = "<color=white>";
                string detainedinfo = "<color=white>";
                if (ev.Target.Role == RoleType.ClassD && SnapDetection.NotSCP(ev.Attacker) && ev.Target.Role != ev.Attacker.Role)
                {
                    kosinfo = "<color=red>****POSSIBLE KOS****<color=white> ";
                }
                if (ev.Target.IsCuffed && SnapDetection.NotSCP(ev.Attacker) && ev.Target.Role != ev.Attacker.Role)
                {
                    detainedinfo = "<color=blue>****DETAINED KILL****<color=white> ";
                }

                foreach (Exiled.API.Features.Player ply in Exiled.API.Features.Player.List)
                {
                    if (ply.ReferenceHub.serverRoles.RemoteAdmin)
                    {
                        ply.RemoteAdminMessage($"{kosinfo}{detainedinfo}{ev.Attacker.Nickname} {ev.Attacker.UserId} ({ev.Attacker.Role}) killed {ev.Target.Nickname} ({ev.Target.Role}) with {DamageTypes.FromIndex(ev.HitInformations.Tool).name}.</color>", true, "KingsSCPSL");
                    }
                }
            }
        }
コード例 #2
0
 public async void OnDying(DyingEventArgs ev)
 {
     if (Instance.Config.EventsToLog.PlayerDying &&
         ev.Killer != null &&
         ev.Target != null &&
         ((!ev.Killer.DoNotTrack && !ev.Target.DoNotTrack) || !Instance.Config.ShouldRespectDoNotTrack) &&
         (!Instance.Config.ShouldLogFriendlyFireKillsOnly || (Instance.Config.ShouldLogFriendlyFireKillsOnly && ev.Killer.Side == ev.Target.Side && ev.Killer != ev.Target)))
     {
         await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(Language.HasKilledWith, ev.Killer.Nickname, Instance.Config.ShouldLogUserIds ? ev.Killer.UserId : Language.Redacted, ev.Killer.Role, ev.Target.Nickname, Instance.Config.ShouldLogUserIds ? ev.Target.UserId : Language.Redacted, ev.Target.Role, DamageTypes.FromIndex(ev.HitInformation.Tool).name))).ConfigureAwait(false);
     }
 }
コード例 #3
0
 public async void OnDying(DyingEventArgs ev)
 {
     if (Instance.Config.EventsToLog.PlayerDying &&
         ev.Killer != null &&
         ev.Target != null &&
         (!ev.Killer.DoNotTrack || !ev.Target.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack) &&
         (!Instance.Config.ShouldLogFriendlyFireKillsOnly || (Instance.Config.ShouldLogFriendlyFireKillsOnly && ev.Killer.Side == ev.Target.Side && ev.Killer != ev.Target)))
     {
         await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(Language.HasKilledWith, ev.Killer.Nickname, ev.Killer.Id.ToString(), ev.Killer.Role.Translate(), ev.Target.Nickname, ev.Target.Id.ToString(), ev.Target.Role.Translate(), DamageTypes.FromIndex(ev.HitInformation.Tool).name))).ConfigureAwait(false);
     }
     else if (Instance.Config.EventsToLog.PlayerDying &&
              ev.Killer != null &&
              ev.Target != null &&
              (!ev.Killer.DoNotTrack || !ev.Target.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack) &&
              (!Instance.Config.ShouldLogFriendlyFireKillsOnly || (Instance.Config.ShouldLogFriendlyFireKillsOnly && ev.Killer.Side == ev.Target.Side && ev.Killer != ev.Target && ev.Target.IsCuffed && ev.Target.Role == RoleType.ClassD && ev.Killer.Team == Team.MTF)))
     {
         await Network.SendAsync(new RemoteCommand("log", "gameEvents", $"<:ClassDShook:817324555654791199> | {ev.Killer.Nickname} (ID:{ev.Killer.Id} - ROL: {ev.Killer.Role.Translate()} ) Mato a {ev.Target.Nickname} (ID: {ev.Target.Id} - ROL: {ev.Target.Role.Translate()} ) que era un Class-D Arrestado. Lo mato con {DamageTypes.FromIndex(ev.HitInformation.Tool).name}")).ConfigureAwait(false);
     }
 }
コード例 #4
0
 public async void OnHurting(HurtingEventArgs ev)
 {
     if (Instance.Config.EventsToLog.HurtingPlayer &&
         ev.Attacker != null &&
         ev.Target != null &&
         ((!ev.Attacker.DoNotTrack && !ev.Target.DoNotTrack) || !Instance.Config.ShouldRespectDoNotTrack) &&
         (!Instance.Config.ShouldLogFriendlyFireDamageOnly || (Instance.Config.ShouldLogFriendlyFireDamageOnly && ev.Attacker.Side == ev.Target.Side && ev.Attacker != ev.Target)) &&
         (ev.DamageType != DamageTypes.Scp207 || (ev.DamageType == DamageTypes.Scp207 && Instance.Config.ShouldLogScp207Damage)))
     {
         await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(Language.HasDamagedForWith, ev.Attacker.Nickname, Instance.Config.ShouldLogUserIds ? ev.Attacker.UserId : Language.Redacted, ev.Attacker.Role, ev.Target.Nickname, Instance.Config.ShouldLogUserIds ? ev.Target.UserId : Language.Redacted, ev.Target.Role, ev.Amount, DamageTypes.FromIndex(ev.Tool).name))).ConfigureAwait(false);
     }
 }
コード例 #5
0
 public async void OnHurting(HurtingEventArgs ev)
 {
     // Verifico si el tipo tiene un medigun primero, y si no paso al log normal.
     if (Instance.Config.EventsToLog.HurtingPlayer &&
         ev.Attacker != null &&
         ev.Target != null &&
         (!ev.Attacker.DoNotTrack || !ev.Target.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack) &&
         (!Instance.Config.ShouldLogFriendlyFireDamageOnly || (Instance.Config.ShouldLogFriendlyFireDamageOnly && ev.Attacker.Side == ev.Target.Side && ev.Attacker != ev.Target)) && CustomItem.TryGet(ev.Attacker.CurrentItem, out CustomItem medigun) && medigun.CheckMediGun())
     {
         await Network.SendAsync(new RemoteCommand("log", "gameEvents", $"<a:MediGun:841062245349720094> | **{ev.Attacker.Nickname}** (ID: {ev.Attacker.Id} - ROL: {ev.Attacker.Role.Translate()}) **esta curando** a **{ev.Target.Nickname}** (ID: {ev.Target.Id} ROL: {ev.Target.Role.Translate()} Con su arma que es {DamageTypes.FromIndex(ev.Tool).name} | Curacion hecha: {ev.Amount}")).ConfigureAwait(false);
     }
     else if (Instance.Config.EventsToLog.HurtingPlayer &&
              ev.Attacker != null &&
              ev.Target != null &&
              (!ev.Attacker.DoNotTrack || !ev.Target.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack) &&
              (!Instance.Config.ShouldLogFriendlyFireDamageOnly || (Instance.Config.ShouldLogFriendlyFireDamageOnly && ev.Attacker.Side == ev.Target.Side && ev.Attacker != ev.Target)))
     {
         await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(Language.HasDamagedForWith, ev.Attacker.Nickname, Instance.Config.ShouldLogUserIds ? ev.Attacker.Id.ToString() : Language.Redacted, ev.Attacker.Role.Translate(), ev.Target.Nickname, ev.Target.Id.ToString(), ev.Target.Role.Translate(), ev.Amount, DamageTypes.FromIndex(ev.Tool).name))).ConfigureAwait(false);
     }
     else
     {
         return;
     }
 }