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

Solved Add more commands?

Discussion in 'Help' started by A354-PH, Oct 29, 2018.

  1. A354-PH

    A354-PH Baby Zombie

    Messages:
    186
    GitHub:
    Kizu
    Hey guys how do i add more commands in this code?
    PHP:
    public function onCommand(CommandSender $senderCommand $cmdstring $label, array $args):bool
        
    {
            switch(
    $cmd->getName()){
            case 
    "buyrank":
              if(!
    $sender instanceof Player){
                    
    $sender->sendMessage("§cThis command can't be used here.");
                    return 
    true;
              }
              
    $api $this->getServer()->getPluginManager()->getPlugin("FormAPI");
              
    $form $api->createSimpleForm(function (Player $sender$data){
                  
    $result $data;
                  if (
    $result == null) {
                  }
                  switch (
    $result) {
                          case 
    0:
                              break;
                          case 
    1:
                          
    $this->vip($sender);
                              break;
                          case 
    2:
                          
    $this->vipplus($sender);
                              break;
                  }
              });
              
    $form->setTitle("§lRanks");
              
    $form->setContent("§7Select Rank You Want To Buy.");
              
    $form->addButton("§l§cExit"0);
              
    $form->addButton("§lVIP | 10000"1);
              
    $form->addButton("§lVIP+ | 15000"2);
              
    $form->sendToPlayer($sender);
              }
              return 
    true;
     
  2. Destroyer57

    Destroyer57 Zombie

    Messages:
    275
    {
    switch($cmd->getName()){
    case "command1":
    dosomething

    case "command2":
    dosomething
     
  3. Kkora

    Kkora Baby Zombie

    Messages:
    189
    GitHub:
    shisui203
    insert command in " case:"(command you wanted to insert)" "
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
  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.