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

Error when i try to set the ChatFormat

Discussion in 'Development' started by Jonas, May 20, 2017.

  1. Jonas

    Jonas Baby Zombie

    Messages:
    192
    I have only change "playername" to $nick
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    That should work
     
  3. Jonas

    Jonas Baby Zombie

    Messages:
    192
    No, then comes this error by this Code:
    Code:
    [Server] [PocketMine] [16:59:08] CRITICAL> "Could not pass event 'pocketmine\event\player\PlayerChatEvent' to 'Nick v1.0.1': Argument 1 passed to _64FF00\PurePerms\PurePerms::setGroup() must implement interface pocketmine\IPlayer, string given, called in /storage/emulated/0/PocketMine/plugins/Nick/src/UniverseNick/JonasGehtMitte/Nick.php on line 168 on UniverseNick\JonasGehtMitte\Nick
    [Server] [PocketMine] [16:59:08] CRITICAL> TypeError: "Argument 1 passed to _64FF00\PurePerms\PurePerms::setGroup() must implement interface pocketmine\IPlayer, string given, called in /storage/emulated/0/PocketMine/plugins/Nick/src/UniverseNick/JonasGehtMitte/Nick.php on line 168" (EXCEPTION) in "/PurePerms.phar/src/_64FF00/PurePerms/PurePerms" at line 659
    [Server] [PocketMine] [16:59:08] INFO> [Developer] Guest | Serus Haralain > a
    
    PHP:
    $event->setFormat($this->getServer()->getPluginManager()->getPlugin("PurePerms")->getGroup(Server::getInstance()->getOfflinePlayer("playername")). $nick$msg);
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Yeah because you are calling ...getPlugin("PurePerms")->getGroup().

    This was also answered
    Use
    PHP:
    ...getPlugin("PurePerms")->getUserDataMgr()->getGroup(Server::getInstance()->getOfflinePlayer($nick))
    Better use $this->getServer() instead of Server::getInstance(), I didn't know your code's class so I used that.
     
  5. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Thanks it works to 50 % in the RCON got this message when i send a message and it comes no errors
    Code:
    [Server] [PocketMine] [19:27:04] INFO> [Developer] Guest | BestNickEverXD > a
     
    Muqsit likes this.
  6. Jonas

    Jonas Baby Zombie

    Messages:
    192
    How can i remove [Developer] to [Guest]?
     
  7. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    We dont support spoons.
     
    jasonwynn10 likes this.
  8. Jonas

    Jonas Baby Zombie

    Messages:
    192
    ?
     
  9. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    You arent using PocketMine-MP, i can see that from the log. You are using a spoon. My first guess was Elywing, but im not sure.
     
    jasonwynn10 likes this.
  10. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Can anybody give me an answer?
     
  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.