refactor
This commit is contained in:
+2
-4
@@ -1,5 +1,4 @@
|
||||
using LabApi.Events.Handlers;
|
||||
using LabApi.Features;
|
||||
using LabApi.Features;
|
||||
using LabApi.Loader.Features.Plugins;
|
||||
|
||||
namespace ScpSwap;
|
||||
@@ -11,13 +10,12 @@ public class ScpSwap : Plugin
|
||||
public override Version Version { get; } = new(1, 0, 0);
|
||||
public override string Description => "Swap SCPs.";
|
||||
public override Version RequiredApiVersion { get; } = new(LabApiProperties.CompiledVersion);
|
||||
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Disable()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
<HintPath>..\dependencies\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CommandSystem.Core">
|
||||
<HintPath>..\dependencies\CommandSystem.Core.dll</HintPath>
|
||||
<HintPath>..\dependencies\CommandSystem.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mirror">
|
||||
<HintPath>..\dependencies\Mirror.dll</HintPath>
|
||||
@@ -38,6 +38,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Northwood.LabAPI" Version="1.0.2" />
|
||||
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -40,18 +40,19 @@ public class SwapCommand : ICommand
|
||||
"096",
|
||||
"106",
|
||||
"173",
|
||||
"939",
|
||||
"939"
|
||||
];
|
||||
|
||||
var arg = arguments.First();
|
||||
|
||||
|
||||
if (!validScp.Contains(arg))
|
||||
{
|
||||
response = "Invalid SCP number.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Player.List.Where(x=>x.IsSCP).Select(x=>x.RoleBase).Any(playerRole => playerRole.RoleName == "SCP-" + arg))
|
||||
|
||||
if (Player.List.Where(x => x.IsSCP).Select(x => x.RoleBase)
|
||||
.Any(playerRole => playerRole.RoleName == "SCP-" + arg))
|
||||
{
|
||||
response = "Already exists";
|
||||
return false;
|
||||
@@ -69,7 +70,7 @@ public class SwapCommand : ICommand
|
||||
};
|
||||
|
||||
player.SetRole(role);
|
||||
|
||||
|
||||
response = "Swapping...";
|
||||
|
||||
return true;
|
||||
@@ -77,5 +78,5 @@ public class SwapCommand : ICommand
|
||||
|
||||
public string Command { get; } = "scpswap";
|
||||
public string[] Aliases { get; } = ["ss"];
|
||||
public string Description { get; } = "Swaps SCPs";
|
||||
public string Description { get; } = "Swaps SCPs";
|
||||
}
|
||||
Reference in New Issue
Block a user