From bbeef2adbaf75f8bb99605a1d267e15726e5cfd8 Mon Sep 17 00:00:00 2001 From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com> Date: Mon, 8 Jan 2024 18:16:37 +0100 Subject: [PATCH] Non auth player fix --- CS2-Tags.cs | 8 ++++---- README.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CS2-Tags.cs b/CS2-Tags.cs index a9c2479..3f5a810 100644 --- a/CS2-Tags.cs +++ b/CS2-Tags.cs @@ -164,8 +164,8 @@ public class CS2_Tags : BasePlugin private HookResult OnPlayerChat(CCSPlayerController? player, CommandInfo info) { - if (player == null || !player.IsValid || info.GetArg(1).Length == 0) return HookResult.Continue; - string steamid = player.AuthorizedSteamID!.SteamId64.ToString(); + if (player == null || !player.IsValid || info.GetArg(1).Length == 0 || player.AuthorizedSteamID == null) return HookResult.Continue; + string steamid = player.AuthorizedSteamID.SteamId64.ToString(); if (GaggedIds.Contains((int)player.Index)) return HookResult.Handled; @@ -246,8 +246,8 @@ public class CS2_Tags : BasePlugin private HookResult OnPlayerChatTeam(CCSPlayerController? player, CommandInfo info) { - if (player == null || !player.IsValid || info.GetArg(1).Length == 0) return HookResult.Continue; - string steamid = player.AuthorizedSteamID!.SteamId64.ToString(); + if (player == null || !player.IsValid || info.GetArg(1).Length == 0 || player.AuthorizedSteamID == null) return HookResult.Continue; + string steamid = player.AuthorizedSteamID.SteamId64.ToString(); if (GaggedIds.Contains((int)player.Index)) return HookResult.Handled; diff --git a/README.md b/README.md index 1a67768..12fbe0c 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Adds tags to the server that can be easily edited, tags can be assigned via perm In addons/counterstrikesharp/plugins/CS2-Tags/tags.json ### Requirments -[CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp/) **tested on v61** +[CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp/) **tested on v142** ### Colors ```