So i made this Command class and for some reason its not being loaded on the server idk why
namespace MothSCP372.commands
{
[CommandHandler(typeof(RemoteAdminCommandHandler))]
public class MSpawnSCP : ICommand
{
public Dictionary<CustomSCPs, Type> Spawners = new Dictionary<CustomSCPs, Type>()
{
{CustomSCPs.SCP372, typeof(SCP372EventsHandler) }
};
public string Command { get; } = "MSpawnSCP";
public string[] Aliases { get; } = new string[] { };
public string Description { get; } = "Spawn a Custom SCP \n Moth_SpawnCustomSCP <ID> <CUSTOM_SCP>";
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
Player player = Player.Get(sender);
if (!sender.HasAnyPermission("MothCustomSCPs"))
{
response = "NIE MASZ PERMISJI";
return false;
}
int ID = Int32.Parse(arguments.At(0));
Player target = Player.Get(ID);
if (target == null)
{
response = "Nie ma gracza o takim ID na serwerze";
return false;
}
CustomSCPs? NewCustomRole = null;
if (Enum.TryParse<CustomSCPs>(arguments.At(1).ToString(), true, out var parse))
{
NewCustomRole = parse;
}
else
{
response = "Nie ma takiego Customowego SCPEKA";
return false;
}
if (NewCustomRole.HasValue && Spawners.TryGetValue(NewCustomRole.Value, out var type))
{
var NewCustomSCP = (BaseCustomSCPEventHandler)Activator.CreateInstance(type);
NewCustomSCP.SpawnCustomSCP(target);
}
response = "NOWY SCP ZOSTAL ZRESPIONY!";
return true;
}
}
}