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

Solved Argument 2 passed

Discussion in 'Development' started by armagadon159753, Sep 24, 2017.

  1. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    The first argument to CommandMap::register() should be the fallback prefix that uses can type. For example, if two plugins both register the /info command, one with the prefix "foo" and one with "bar", the user can use both commands with /foo:info and /bar:info.
     
  3. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
    https://pastebin.com/YtRR0H6V
    I want use on command to show UI but nothing happen
     
  4. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    You cannot use onCommand() if you want to register a new command like that. You need to create a command classs and add all your command's code there.
     
    armagadon159753 likes this.
  5. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
    Yea they are command class and subcommand but want to dell sub command
     
  6. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    Put your sub-command's code into the command's class.
     
  7. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
    I have true i can use
    public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args) : bool {
    $plugin = $this->getServer()->getPluginManager()->getPlugin("customuitest");
    if($cmd->getName() == "test"){
    UIAPI::showUIbyID($plugin, Loader::$uis['simpleUI'], $sender);
    }
    return true;
    }

    To show UI. M'y code work great
     
  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.