From 06808d081cf424a46779c42bcca6c778f82f32ab Mon Sep 17 00:00:00 2001 From: joahreason Date: Mon, 20 Nov 2023 14:37:16 -0500 Subject: [PATCH] Console commands and join teams as unassigned --- GoSpec.cs | 14 ++++++++++---- .../{gospec-v1.1.zip => gospec-v1.2.zip} | Bin 71317 -> 71317 bytes 2 files changed, 10 insertions(+), 4 deletions(-) rename bin/Debug/net7.0/{gospec-v1.1.zip => gospec-v1.2.zip} (99%) diff --git a/GoSpec.cs b/GoSpec.cs index 912780e..5bd7dcc 100644 --- a/GoSpec.cs +++ b/GoSpec.cs @@ -16,7 +16,7 @@ public class GoSpec : BasePlugin Console.WriteLine($"{ModuleName} version {ModuleVersion} by {ModuleAuthor} is active."); } - [ConsoleCommand("spec", "Moves you to spec.")] + [ConsoleCommand("css_spec", "Moves you to spec.")] [CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)] public void OnSpecCommand(CCSPlayerController? caller, CommandInfo command) { @@ -37,14 +37,14 @@ public class GoSpec : BasePlugin public void OnBRBCommand(CCSPlayerController? caller, CommandInfo command) => OnSpecCommand(caller, command); #endregion - [ConsoleCommand("ct", "Joins the counterterrorist team.")] + [ConsoleCommand("css_ct", "Joins the counterterrorist team.")] [CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)] public void OnJoinCTCommand(CCSPlayerController? caller, CommandInfo command) { ChangeTeam(caller, CsTeam.CounterTerrorist); } - [ConsoleCommand("t", "Joins the terrorist team.")] + [ConsoleCommand("css_t", "Joins the terrorist team.")] [CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)] public void OnJoinTCommand(CCSPlayerController? caller, CommandInfo command) { @@ -61,7 +61,7 @@ public class GoSpec : BasePlugin return false; } - if (!IsInSpec(caller) && moveTo != CsTeam.Spectator) + if (!IsUnassigned(caller) && moveTo != CsTeam.Spectator) { caller.PrintToChat($"{ChatColors.Red}You must be in spec to use this command."); return false; @@ -94,6 +94,12 @@ public class GoSpec : BasePlugin return count; } + private bool IsUnassigned(CCSPlayerController? caller) + { + if (caller == null) return false; + return caller.TeamNum != (int)CsTeam.Terrorist && caller.TeamNum != (int)CsTeam.CounterTerrorist; + } + private bool IsInSpec(CCSPlayerController? caller) { if (caller == null) return false; diff --git a/bin/Debug/net7.0/gospec-v1.1.zip b/bin/Debug/net7.0/gospec-v1.2.zip similarity index 99% rename from bin/Debug/net7.0/gospec-v1.1.zip rename to bin/Debug/net7.0/gospec-v1.2.zip index 8eba9302c3afad5befa899553e3e7ab00fab59d7..b16245f8488418c51f84ac7244926b45aec73f40 100644 GIT binary patch delta 74 zcmbQbmSyT%7Ty4FW)=|!1_lm>tl5PddA~9;=arOfW@Vbf3t}|S;om-opHYF887Mn_ XzX+ofNOU@jD5DLCvE5meF^CZWD3}#( delta 74 zcmbQbmSyT%7Ty4FW)=|!1_lm>S8)X!dA~9;FPc@jnU!e@FNo1RhkyGVentgWW}xi! X{UVG`Akpb8qKq~m#&%~>#vn!jWvUlV