Skip to content

Commit

Permalink
V1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
1Mack committed May 12, 2024
1 parent 563838b commit fa7f3cd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 1 addition & 3 deletions CallAdmin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ private HookResult OnPlayerChat(CCSPlayerController? player, CommandInfo info)
{
if (player == null || !player.IsValid || player.IsBot) return HookResult.Continue;
var findPlayer = CustomMessagePlayers.Find(obj => obj.Player == (int)player.Index);

if (findPlayer == null || !findPlayer.HandleMessage || findPlayer.Target == null ||
info.GetArg(1).StartsWith('!') || info.GetArg(1).StartsWith('/') || info.GetArg(1) == "rtv") return HookResult.Continue;

info.GetArg(1).StartsWith('!') || info.GetArg(1).StartsWith('/') || Array.Exists(Config.ReasonsToIgnore, element => element == info.GetArg(1))) return HookResult.Continue;
var findTarget = Utilities.GetPlayerFromIndex((int)findPlayer.Target);

HandleSentToDiscordAsync(player, findTarget!, info.ArgString.Replace("\"", ""));
Expand Down
5 changes: 4 additions & 1 deletion Commands/Report.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ public void ReportCommand(CCSPlayerController? player, CommandInfo command)
}
if (CanExecuteCommand(player.Slot))
{
var getPlayers = Utilities.GetPlayers().Where(p => p != null && !p.IsBot && !p.IsHLTV && p.AuthorizedSteamID != null && !Config.Debug ? p.Index != player.Index : true);
var getPlayers = Utilities.GetPlayers()
.Where(p => p.IsValid && p.AuthorizedSteamID != null && !Config.Debug ? p.Index != player!.Index : true)
.Where(p => !p.IsBot && !p.IsHLTV)
.Where(p => Config.Commands.ReportFlagsToIgnore.Length == 0 || !AdminManager.PlayerHasPermissions(p, Config.Commands.ReportFlagsToIgnore));

if (!getPlayers.Any())
{
Expand Down
2 changes: 2 additions & 0 deletions Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public class Commands
public string[] ReportPrefix { get; set; } = ["report", "calladmin"];
[JsonPropertyName("ReportPermission")]
public string[] ReportPermission { get; set; } = [];
[JsonPropertyName("ReportFlagsToIgnore")]
public string[] ReportFlagsToIgnore { get; set; } = [];
[JsonPropertyName("ReportHandledEnabled")]
public bool ReportHandledEnabled { get; set; } = true;
[JsonPropertyName("ReportHandledPrefix")]
Expand Down

0 comments on commit fa7f3cd

Please sign in to comment.