Skip to content

Commit

Permalink
Non auth player fix
Browse files Browse the repository at this point in the history
  • Loading branch information
daffyyyy committed Jan 8, 2024
1 parent da83d84 commit bbeef2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions CS2-Tags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ private HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info)

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;

Expand Down Expand Up @@ -246,8 +246,8 @@ private HookResult OnPlayerChat(CCSPlayerController? player, CommandInfo info)

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;

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down

0 comments on commit bbeef2a

Please sign in to comment.