Solved Command still OP default but is true in plugin.yml

Discussion in 'Development' started by Kygekraqmak, Aug 1, 2020.

  1. Kygekraqmak

    Kygekraqmak Spider Jockey

    Messages:
    32
    GitHub:
    Kygekraqmak
    I need a second help for my KygekRulesUI plugin. Why when I set the permission of /rules to true in plugin.yml, when I'm not op or get the permission, it said that I don't have permission. What's wrong? Can anyone help me and what should I do?

    My Project: https://github.com/Kygekraqmak/KygekRulesUI

    plugin.yml:
    Code:
    commands:
        rules:
            description: Server rules in UI form
            usage: /rules
            permissions:
                rules.command:
                    description: Permission to use KygekRulesUI
                    default: true
    Main.php:
    PHP:
    public function onCommand(CommandSender $playerCommand $cmdstring $label, array $args) : bool {
            switch(
    $cmd->getName()) {
                case 
    "rules":
                    if(!
    $player instanceof Player) {
                        
    $player->sendMessage("[KygekRulesUI] This command only works in game!");
                    } else {
                        if(!
    $player->hasPermission("rules.command")) {
                            
    $player->sendMessage("[KygekRulesUI] You do not have permission to use this command!");
                        } else {
                            
    $this->kygekRulesUI($player);
                        }
                    }
            }
            return 
    true;
        }
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    410
    Code:
    commands:
        rules:
            description: Server rules in UI form
            permission: rules.command
            usage: /rules
    permissions:
        rules.command:
            description: Permission to use KygekRulesUI
            default: true
    
    °
    You're welcome :)
     
  3. GodWeedZao

    GodWeedZao Zombie

    Messages:
    246
    GitHub:
    godweedzao
    i have a question, why you dont learn php then start coding?!
     
  4. GodWeedZao

    GodWeedZao Zombie

    Messages:
    246
    GitHub:
    godweedzao
    you didnt set Permission to command, first set perm to cmd and then define perm in permission: and its done
     
  5. Primus

    Primus Zombie Pigman

    Messages:
    410
    Here's where I started: http://forums.pocketmine.net/members/primus.25050/

    Asking dumb af questions. But that community at the time was super friendly and here I am now. 5 years passed and I'm able to help others without even developing plugins myself. I am here just to give back to that community. I'll stay till the last day.
     
  6. Kygekraqmak

    Kygekraqmak Spider Jockey

    Messages:
    32
    GitHub:
    Kygekraqmak
    Btw the problem's solved.
     
    Primus likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.