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

hasPermission() Issues / Misunderstanding

Discussion in 'Development' started by NickteeChunky, Nov 7, 2019.

  1. NickteeChunky

    NickteeChunky Witch

    Messages:
    64
    GitHub:
    nickteechunky
    Code:
    Server thread/CRITICAL InvalidStateException: "Trying to get permissions of closed player" (EXCEPTION) in "src/pocketmine/Player" at line 678
    I am having an issue with hasPermission() and I don't get what closed players are. If anyone can give me further information, it would be much appreciated.

    PHP:
                           $target $this->getServer()->getPlayerExact($this->targettPlayer);
                           if(!
    $target->hasPermission("warn.1") && !$target->hasPermission("warn.2") && !$target->hasPermission("warn.3")){
                               
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "setuperm ".$target->getName()." warn.1");
                               
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "rca ".$player->getName()." kick ".$target->getName(). " \"§aSpamming - Warning 1\"");
                           }
    $this->targettPlayer = $data from another form
     
  2. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    is $target online?
     
  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.