Created
May 12, 2020 15:10
-
-
Save PJZ9n/064371c003fa5078941277bd8da1a22e to your computer and use it in GitHub Desktop.
Dropdownでプレイヤーを選ばせる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| /** @var \pocketmine\Server $server */ | |
| $players = $server->getOnlinePlayers(); | |
| $options = array_map(function ($player) { | |
| /** @var \pocketmine\Player $player */ | |
| return $player->getName(); | |
| }, $players); | |
| $form = [ | |
| "type" => "custom_form", | |
| "title" => "タイトル", | |
| "content" => [ | |
| [ | |
| "type" => "dropdown", | |
| "text" => "プレイヤーを選んでください", | |
| "options" => $options, | |
| ], | |
| ], | |
| ]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment