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

[SOLVED] /join to join the mine (Prison plugin)

Discussion in 'Requests' started by Groin, May 11, 2017.

  1. Groin

    Groin Baby Zombie

    Messages:
    159
    When a player typed /join command, and his/her rank is S, he/she will join mine S after typed the command :) I hope that it will work with PurePerms... So, anybody can help me, please?
     
  2. 0x15f

    0x15f Baby Zombie

    Messages:
    145
    GitHub:
    0x15f
    I think I understand what you want, I'll assist you with the PurePerms part but I'm not doing everything for you.
    PHP:
    $plugin $this->getServer()->getPluginManager()->getPlugin("PurePerms");

    if(!
    $plugin instanceof \pocketmine\plugin\Plugin)
    {
        return;
    }

    if(!
    $player instanceof \pocketmine\IPlayer)
    {
        return;
    }

    //$player MUST be an instance of pocketmine\IPlayer
    //$group will be an instance of _64FF00\PurePerms\PGroup thats why we call PGroup::getName() so we can compare the groups name to the string "S"
    $group $plugin->getUserDataMgr()->getGroup($player)->getName();

    if(
    $group !== "S")
    {
        return;
    }

    $level $player->getServer()->getLevelByName("S");

    if(!
    $level instanceof pocketmine\level\Level)
    {
        return;
    }

    $player->teleport($level);
     
    Groin and CodeRed2019 like this.
  3. Groin

    Groin Baby Zombie

    Messages:
    159
    No problem. Can you give me full code, please?
     
  4. XCodeMCPE

    XCodeMCPE Slime

    Messages:
    96
    GitHub:
    xcodemcpe
    That's making him do it all.
     
  5. Groin

    Groin Baby Zombie

    Messages:
    159
    What about use a command as player?
    PHP:
    $group $plugin->getUserDataMgr()->getGroup($player)->getName();

    if(
    $group !== "S")
    {
        return;
    }
    $command = ("as $player warp S")
    $this->getServer()->dispatchCommand($player$command);

    {
        return;
    }
     
  6. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    Request section, not development.
     
  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.