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

Help me

Discussion in 'Facepalm' started by MonkeyCortu, Jul 6, 2017.

  1. MonkeyCortu

    MonkeyCortu Creeper

    Messages:
    1
    GitHub:
    monkeycortu
    I do this post to ask for help I want to make a plugin per I do not know how to do it to execute the command and that it is put to a player example / gamemode 1 steve <- that is what I want to do somebody could I explain the code that you use? ? And sorry i'm new to this !!
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    And now in English please....

    What I guessed your message could mean: "How can I execute a command using my plugin?"

    The answer to that is:
    PHP:
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "gamemode 1 steve");
    This code would execute the given command on console
     
  3. MonkeyCortu

    MonkeyCortu Creeper

    Messages:
    1
    GitHub:
    monkeycortu


    What I mean is how the ranks like purechat and pureperms / setgroup MonkeyCortu Owner that's what I mean help please
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    You want to set the rank of another player?
     
  5. MonkeyCortu

    MonkeyCortu Creeper

    Messages:
    1
    GitHub:
    monkeycortu
    Yes
     
  6. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Assuming you are in a class extending PluginBase and assuming $player is an instanceof Player:
    PHP:
    $pureperms $this->getServer()->getPluginManager()->getPlugin("PurePerms");
    $pureperms->setGroup($player$pureperms->getGroup("NAME OF THE RANK HERE"));
     
  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.