Can you coppy PHP: <?phpnamespace Fly;use pocketmine\plugin\PluginBase;use pocketmine\command\{ Command, CommandSender }; use pocketmine\{ Server, Player }; use pocketmine\event\Listener; use pocketmine\event\player\PlayerJoinEvent; use onebone\economyapi\EconomyAPI; class Fly extends PluginBase implements Listener { public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->getLogger()->info("BuyFlyUI เปิดทำงานแล้ว"); $this->getLogger()->info("สามรถแก้ไข้ราคาได้ในconfig.yml"); $this->eco = $this->getServer()->getPluginManager()->getPlugin("EconomyAPI"); } public function checkDepends(): void{ $this->formapi = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); if(is_null($this->formapi)){ $this->getLogger()->error("BuyFly ต้องการ FromAPI ไม่ทำงาน!!"); $this->getPluginLoader()->disablePlugin($this); } $eco = $this->getServer()->getPluginManager()->getPlugin("EconomyAPI"); if(is_null($eco)){ $this->getLogger()->error("BuyFly ต้องการ EconomyAPI ไม่ทำงาน"); $this->getPluginLoader()->disablePlugin($this); } } public function onJoin(PlayerJoinEvent $e){ $sender = $e->getPlayer(); $sender->setGamemode(0); } public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args) : bool { switch($cmd->getName()){ case "buyfly": if ($sender instanceof Player){ $this->Form($sender); }else{ $sender->sendMesseage("§cคำสั่งนี้ใช้ในเกมส์เท่านั้น"); return true; } break; } return true; } public function Form($sender){ $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); $form = $api->createSimpleForm(function (Player $sender, $data){ $result = $data; if ($result == null) { return true; } switch ($result) { case 0: break case 1: $this->ModalForm($sender); break; } }); $money = $this->eco->myMoney($sender); $buy = $this->getConfig()->get("buy"); $form->setTitle("§l§2B§4u§by§dF§6l§ey"); $form->setContent("§cถ้าออกเกมส์บินจะหาย§aราคา§l§e$buy \n§rคุณมีเงิน$money"); $form->addButton("ออก"); $form->addButton("ซื้อบินด้วยเงิน$buy"); $form->sendToPlayer($sender); } public function ModalForm($sender){ $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); $form = $api->createModalForm(function (Player $sender, $data){ $result = $data; if ($result == null) { } switch ($result) { case 1: $money = $this->eco->myMoney($sender); $buy = $this->getConfig()->get("buy"); if($money >= $buy){ $this->eco->reduceMoney($sender, $buy); $sender->setAllowFlight(true); $sender->sendMessage("§aซื้อบินด้วยเงินสำเร็จ$buy"); }else{ $sender->sendMessage("§cเงินไม่พอ"); } break; case 2: $this->Main($sender); break; } }); $buy = $this->getConfig()->get("buy"); $form->setTitle("BuyFly "); $form->setContent("คุณต้องการชื้อบินด้วยเงิน $buy หรอ"); $form->setButton1("ชื้อ"); $form->setButton2("กลับ"); $form->sendToPlayer($sender); } }