Compare commits

..

No commits in common. "main" and "release-v1.1" have entirely different histories.

9 changed files with 8 additions and 18 deletions

View file

@ -9,14 +9,14 @@ public class GoSpec : BasePlugin
{ {
public override string ModuleName => "GoSpec"; public override string ModuleName => "GoSpec";
public override string ModuleAuthor => "cosmic sans"; public override string ModuleAuthor => "cosmic sans";
public override string ModuleVersion => "1.2"; public override string ModuleVersion => "1.1";
public override void Load(bool hotReload) public override void Load(bool hotReload)
{ {
Console.WriteLine($"{ModuleName} version {ModuleVersion} by {ModuleAuthor} is active."); Console.WriteLine($"{ModuleName} version {ModuleVersion} by {ModuleAuthor} is active.");
} }
[ConsoleCommand("css_spec", "Moves you to spec.")] [ConsoleCommand("spec", "Moves you to spec.")]
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)] [CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
public void OnSpecCommand(CCSPlayerController? caller, CommandInfo command) 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); public void OnBRBCommand(CCSPlayerController? caller, CommandInfo command) => OnSpecCommand(caller, command);
#endregion #endregion
[ConsoleCommand("css_ct", "Joins the counterterrorist team.")] [ConsoleCommand("ct", "Joins the counterterrorist team.")]
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)] [CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
public void OnJoinCTCommand(CCSPlayerController? caller, CommandInfo command) public void OnJoinCTCommand(CCSPlayerController? caller, CommandInfo command)
{ {
ChangeTeam(caller, CsTeam.CounterTerrorist); ChangeTeam(caller, CsTeam.CounterTerrorist);
} }
[ConsoleCommand("css_t", "Joins the terrorist team.")] [ConsoleCommand("t", "Joins the terrorist team.")]
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)] [CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
public void OnJoinTCommand(CCSPlayerController? caller, CommandInfo command) public void OnJoinTCommand(CCSPlayerController? caller, CommandInfo command)
{ {
@ -61,7 +61,7 @@ public class GoSpec : BasePlugin
return false; return false;
} }
if (!IsUnassigned(caller) && moveTo != CsTeam.Spectator) if (!IsInSpec(caller) && moveTo != CsTeam.Spectator)
{ {
caller.PrintToChat($"{ChatColors.Red}You must be in spec to use this command."); caller.PrintToChat($"{ChatColors.Red}You must be in spec to use this command.");
return false; return false;
@ -94,12 +94,6 @@ public class GoSpec : BasePlugin
return count; 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) private bool IsInSpec(CCSPlayerController? caller)
{ {
if (caller == null) return false; if (caller == null) return false;

View file

@ -1,5 +1,5 @@
# GoSpec v1.1 # GoSpec v1.0
CounterStrikeSharp plugin for allowing players to move themselves to spec by typing **!spec** in chat. CounterStrikeSharp plugin for allowing players to move themselves to spec by typing **!spec** in chat or **css_spec** in console.
## Installation ## Installation
1. Install [CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp) and [Metamod](https://www.sourcemm.net/) 1. Install [CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp) and [Metamod](https://www.sourcemm.net/)
@ -8,8 +8,4 @@ CounterStrikeSharp plugin for allowing players to move themselves to spec by typ
4. Move `GoSpec` folder into your server's `addons/counterstrikesharp/plugins` folder. 4. Move `GoSpec` folder into your server's `addons/counterstrikesharp/plugins` folder.
## Commands ## Commands
`css_spec`: `!spec` in chat to move to spec [_Alternatives:_ `!s`, `!afk`, `!brb`] **Spec:** `!spec` in chat to move to spec
`css_ct`: `!ct` in chat to join ct from spec/unassigned
`css_t`: `!t` in chat to join t from spec/unassigned

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.