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

incorrect code

Discussion in 'Plugin Help' started by rektpixel, Jun 4, 2017.

  1. rektpixel

    rektpixel Baby Zombie

    Messages:
    186
    hello I have this error in the latest pocketmine build on the RankUp plugin. The plugin disables for reason:
    Code:
    [11:59:12] [Server thread/CRITICAL]: ErrorException: "Undefined index: exit" (EXCEPTION) in "/plugins/RankUp-master/src/rankup/doesgroups/RankUpDoesGroups" at line 66
    
    This is line 66 of rankup, idk whats wrong with it
    PHP:
                $this->groups[$name] = new Group($this$name$perms$groupData['entrance'], $groupData['exit'], $groupData['members']);
    Line 57 - 72
    PHP:
        public function initPermissions(){
            foreach(
    $this->config->get('groups') as $name => $groupData){
                
    $perms = [];
                foreach(
    $groupData['perms'] as $str){
                    
    $str $this->getServer()->getPluginManager()->getPermission($str);
                    if(
    $str instanceof Permission){
                        
    $perms[] = $str;
                    }
                }
                
    $this->groups[$name] = new Group($this$name$perms$groupData['entrance'], $groupData['exit'], $groupData['members']);
            }
        }
        
    /*
         * Do NOT use this function
         */
        
    public function saveMembers(){
    Please help! thanks
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    That error means that 'exit' isn't an array key in $groupData
    Syntax errors such as these should be posted on StackOverflow instead of these forums.
     
  3. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Correct syntax for `groups` in config:
    Code:
    groups:
      groupNameHere:
        entrance: whatever-should-be-here
        exit: whatever-should-be-here
        members: whatever-should-be-here
        perms: [an.array, of.permissions.here]
      anotherGroupNameHere:
        entrance: whatever-should-be-here
        exit: whatever-should-be-here
        members: whatever-should-be-here
        perms: [an.array, of.permissions.here]
    
     
    falk likes this.
  4. falk

    falk Slime Poggit Reviewer

    Messages:
    75
    GitHub:
    falkirks
    @SOFe is correct. Adding to that, RankUpDoesGroups is really rough and quickly put together, which means you may run into errors like this. If you are looking for a more advanced group manager, you should consider trying PurePerms.

    I will try to get a fix out for this soon, hopefully I don't forget.
     
    jasonwynn10 likes this.
  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.