"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
Please can u give the explanation for what i am wrong or just give the code because i really don't understand if you give the code i understand it really quickly i can't understand w3schools either
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.
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?
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.
You shouldn't place the "public $queued = []" inside a function. You would declare it outside, like this: https://github.com/minijaham/FeedHealCMD/blob/master/src/FeedHealCMD/Main.php#L17
Now what? also, it worked at first click on the button when i click it again it shows an error or crash the server
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); } } } }