1. this is what i've done after reading many posts about it. class is :RustPlugin.

    registering permission and adding the chat command;
    Code:
    void Init()
            {
                permission.RegisterPermission("saltydeath.admin", this);
                cmd.AddChatCommand("sddisable", this, "DisableCmd");
            }
    the command:
    Code:
    private void DisableCmd(IPlayer player, string command, string[] args)
            {
                if (player.HasPermission("saltydeath.admin"))
                {
                    enableSD = false;
                    Puts("SaltyDeath DISABLED!");
                    player.Reply("SaltyDeath DISABLED!");
                }
                else
                {
                    Puts("You don't have the permission to use the sddisable command.");
                    player.Reply("You don't have the permission to use the sddisable command.");
                }           
            }
    obviously i got it wrong since it does nothing :/
    [DOUBLEPOST=1529076927][/DOUBLEPOST]ok, got it solved:

    Code:
    void Init()
            {
                permission.RegisterPermission("saltydeath.admin", this);
            }
    Code:
    [ChatCommand("sddisable"), Permission("saltydeath.admin")]
            private void DisableCommand(BasePlayer player, string command, string[] args)
            {
                enableSD = false;
                Puts("SaltyDeath DISABLED!");
            }
    how can i check if the player has a permission using BasePlayer?
     
  2. ok, solved too lol
    Code:
    [ChatCommand("sdenable"), Permission("saltydeath.admin")]
            private void EnableCommand(BasePlayer player, string command, string[] args)
            {
                if (permission.UserHasPermission(player.userID.ToString(), "saltydeath.admin"))
                {
                    enableSD = true;
                    Puts("SaltyDeath has been ENABLED!");
                    player.ChatMessage("SaltyDeath has been ENABLED!");
                }
                else
                {
                    player.ChatMessage("You have no permission to use this command.");
                }           
            }