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 ```