Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Register permissions

Comments in 'Plugin Development' started by mamayadesu, May 17, 2015.

  1. mamayadesu
    Offline

    mamayadesu Active Member Plugin Developer

    Joined:
    Sep 19, 2013
    Posts:
    146
    Plugins:
    4
    Minecraft User:
    mamayadesu
    How I can to register permissions WITHOUT writing to plugin.yml?
  2. BlubberBoy333
    Offline

    BlubberBoy333 Active Member

    Joined:
    Aug 31, 2014
    Posts:
    177
    Minecraft User:
    Blubberboy333
    I don't think you can
    iamadpond likes this.
  3. mamayadesu
    Offline

    mamayadesu Active Member Plugin Developer

    Joined:
    Sep 19, 2013
    Posts:
    146
    Plugins:
    4
    Minecraft User:
    mamayadesu
    I found it:
    PHP:
    $this->getServer()->getInstance()->getPluginManager()->addPermission(Permission $perm);
    but how I will add permission if it isn't instance of Permission (Permission doesn't exists => variable-permission can't be instance of Permission).
    PEMapModder likes this.
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Battlekits and SimpleWarp do this. The source is all on GitHub.
    mamayadesu and Artide like this.
  5. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    You can use
    PHP:
    $player->hasPermission("mm.perm");
  6. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    502
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    He is asking how to register permissions, not to check permissions. If you just check the player has permission or not and you don't register permission, player cannot do the action after checking permission (It will return false)
    PEMapModder likes this.
  7. mamayadesu
    Offline

    mamayadesu Active Member Plugin Developer

    Joined:
    Sep 19, 2013
    Posts:
    146
    Plugins:
    4
    Minecraft User:
    mamayadesu
    Thanks

Share This Page

Advertisement