#Command is Not loaded on the server for some reason

1 messages · Page 1 of 1 (latest)

placid gorge
#

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;

        }
    }
}
#

idk did i miss a update or something?

placid gorge
placid gorge
placid gorge
pure carbon
#

did your plugin load?

pure carbon
#

are u looking in remote admin?

#

and not player console

placid gorge
#

its not the first time im making commands in plugin but in that case its simply doesnt load the command for some reason

pure carbon
#

the only thing that could not work with this is that you should add some aliases

#

try that

#

also make sure that your plugin compiled and you're adding the newest .dll