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

Get PurePerms in my plugin?

Discussion in 'Development' started by GOdly, Dec 4, 2016.

  1. GOdly

    GOdly Witch

    Messages:
    50
    GitHub:
    CentOsDogE
    How can i do to get PurePerms's plugin in my code ? What i want to do is get PurePerms to check the player is in the group else it will cancel.
    Example:
    PHP:
    if ($playre->is in group() ) {
          
    /// Do sth
    } else {
         
    /// Do sth
    how can i render the is in group()
     
  2. Infernus101

    Infernus101 Witch

    Messages:
    54
    GitHub:
    infernus102
    If you mean you want to use PurePerms functions in your plugin and get the Player's Rank, here's how you do it..
    PHP:
    $pm $this->getServer()->getPluginManager();
            
    $pp $pm->getPlugin("PurePerms");
            
    $rank $pp->getUserDataMgr()->getGroup($player)->getName();
    Then you can check if the player is in the group you want, by putting an 'if else' condition in your plugin!
    PHP:
    if($rank == 'the group you want the player to be in')
    {
    /// your code
    }
    else {
    /// your code
    }
     
    GOdly likes this.
  3. GOdly

    GOdly Witch

    Messages:
    50
    GitHub:
    CentOsDogE
    Thanks, this is an great idea
     
  4. Infernus101

    Infernus101 Witch

    Messages:
    54
    GitHub:
    infernus102
    No problem :)
     
  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.