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

Show online listings

Discussion in 'Plugin Help' started by Sutimon Phongnonin, Jul 21, 2019.

  1. Sutimon Phongnonin

    Sutimon Phongnonin Creeper

    Messages:
    1
    help me
    I want it to show a list that is online.

    foreach($this->getServer()->getOnlinePlayers() as $player){
    $this->playerList[strtolower($player->getName())] = $player;
    $list = $player->getName();
    }
    $form->addDropdown("§aรายชื่อ§l§e ➤§r", [$list]);
     
  2. Mr174

    Mr174 Baby Zombie

    Messages:
    187
    GitHub:
    mr174
    PHP:
    $players = [];
            
    $players[] = " ";
            foreach (
    $this->plugin->getServer()->getOnlinePlayers() as $player){
                
    $players[] = $player->getName();
            }
           
    $form->addDropdown("",$players);
     
  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.