1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Always send the message that I don't have permissions

Discussion in 'Development' started by bpsys, Nov 14, 2019.

  1. bpsys

    bpsys Spider

    Messages:
    7
    GitHub:
    bptube
    Hello, I need a function to be executed depending on whether or not you have permission, this function should be able to be used by anyone as long as you have permission to use it.
    The problem is that no matter how I configure it in plugins.yml it never lets me use it unless it's op
    Part of the php code:
    PHP:
    if($player->hasPermission("s.buse")){
                
    $player->sendMessage(color::RED.$this->getConfig()->get("siusep"));   
       } else {
                
    $player->sendMessage(color::RED.$this->getConfig()->get("nousep"));
       }
    Plugins YML:
    Code:
    s.buse:
        default: true
        description: It allows
    For more than "default" place any of the following options only run it if it is op:
    True, False, OP
    I don't know if it's wrong or I misunderstood something about permissions, they help me, as I said before I want anyone who has that permission to perform that function
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    Code:
    permissions:
      s.buse:
        default: true
        description: It allows
    
     
  3. bpsys

    bpsys Spider

    Messages:
    7
    GitHub:
    bptube
    You already have the "permissions:"
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    default: op: Only OPs have it, unless the permission is explicitly given to a player using a permission manager
    default: notop: Only players who aren't OPs have it, unless the permission is explicitly given to a player using a permission manager
    default: true: Everyone has it, unless the permission is explicitly removed from a player using a permission manager
    default: false: No one has it, unless the permission is explicitly given to a player using a permission manager
     
    bpsys likes this.
  5. bpsys

    bpsys Spider

    Messages:
    7
    GitHub:
    bptube
    Thank you for clarifying this, I didn't have much information about this.
     
    HimbeersaftLP likes this.
  6. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Is your problem solved by this, or do you still have an issue with your plugin?
     
  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.