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

making join queue

Discussion in 'Plugin Help' started by zenqibruh, Sep 20, 2021.

  1. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    "if he would like to learn" isn't the problem
    He has to learn to code breh

    It's also good for him as well, since no one's going to be willing to answer every single error he faces in the future
     
  2. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi
  3. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Not understanding docs means that you don't understand code as well.

    Seriously. No one will be willing to spoonfeed you every time.
    Plus, I even spoonfed you already. Yet you still didn't understand how to use it correctly.



    I found a good tutorial for beginners. It's simple, easy to understand, and has everything you need for PocketMine development.
     
  4. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi
    Hello since i am beginner to php, i would like to understand arrays. But i couldn't but can you please explain what is the problem? Screenshot_20210921-202442_PocketMine-MP.jpg Screenshot_20210921-202317_Spck Editor.jpg
     
  5. Axon

    Axon Zombie

    Messages:
    276
    Have you tried removing the two brackets? = []
     
    Agent likes this.
  6. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Array is one of the first things you would learn.
    My point of view on "beginner" is different. You should at least know the basics, yet you DON'T

    I bet you didn't even watch a single video on learning php.
     
    Agent and Axon like this.
  7. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Agent, IvanCraft623 and Axon like this.
  8. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi

    Attached Files:

  9. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    The error say you cannot redeclare the function.
    You wrote the function twice
     
    Agent and Axon like this.
  10. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi
    Nah but idk i think i am wrong
     

    Attached Files:

  11. Axon

    Axon Zombie

    Messages:
    276
    The compiler never lies.
     
    Agent, ATVExtremeGamer and minijaham like this.
  12. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi
    I mean i didn't rewrote the function
     
  13. Axon

    Axon Zombie

    Messages:
    276
    The compiler says you did, and it never lies. :p
     
    Agent likes this.
  14. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi
    How did i?
     
  15. Axon

    Axon Zombie

    Messages:
    276
    I don't know how you write your code. Send your source code.
     
    Agent likes this.
  16. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi
    Code:
     {$name}");
          $items = Item::get(264, 0, 1);
          $player->getInventory()->removeItem($items);
          return true;
        }
        if ($itemname === "bruh what") {
          $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI");
          $form = $api->createSimpleForm(function (Player $player, int $data = null){
          $result = $data;
           if($result === null){
              return true;
          }
        function queuePlayer(string $playername) : void {
        if(empty($queued)) { # If no one's in the queue
                              $queued = $playername; # Set the player to the queue
                              return;
                        } # If someone is already in the queue
                        $codeToStartTheGame; # Start the game
                        unset($queued); # Clears the queue
                        return;
                  }
                  // On Button Click
                  # $player instance of Player object
            # Queues the player with the above function
           switch($result){
            case 0:
              queuePlayer($player->getName());
             $player->sendmessage("Players are:");
            break;
          }
    });
          $form->setTitle("§5tenkyu por da hapiyest dei in ma laif");
          $form->setContent("Kaqong");
          $form->addButton("try");
          $form->sendToPlayer($player);
          $player->sendmessage("gay");
          return true;
        }
      }
      public function onBreak(BlockBreakEvent $event) {
       if($event->getBlock()->getId() === 1) {
        $random = mt_rand(1, 100);
         if($random <= 20) {
          $player = $event->getPlayer();
          $name = $player->getName();
          $player->sendmessage("[§6zenqi§r] §6{$name} §rgot a random tag while mining!");
          $drops = array();
          $itembruh = item::get(131, 0, 1);
          $itembruh->setCustomName("Random Tags");
          $drops[] = $itembruh;
          $event->setDrops($drops);
         }
        }
      }
    }
    
     
  17. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi
    Yo
     
  18. Axon

    Axon Zombie

    Messages:
    276
    Please watch or read the videos @minijaham and I have sent.
     
    Agent and minijaham like this.
  19. zenqibruh

    zenqibruh Spider Jockey

    Messages:
    36
    GitHub:
    ohitszenqi
    Screenshot_20210923-203942_PocketMine-MP.jpg Screenshot_20210923-203659_Spck Editor.jpg
    I have watched, and btw its now working.
    But.... WHY
     
  20. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Agent and Axon like this.
  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.