Formapi online players

Discussion in 'Development' started by Azonuno, Oct 12, 2021.

  1. Azonuno

    Azonuno Spider

    Messages:
    11
    $window = new CustomWindowForm("windowtest", "Test", "This is a test");
    $window->addDropdown("users", "Select the users", ["online users?"]);
    $window->showTo($player);


    anyway i can add online players to the drop down menu?
     
  2. Axon

    Axon Zombie

    Messages:
    266
    Store the player names in an array
    PHP:
    foreach(Server::getInstance()->getOnlinePlayers() as $plr){
    $playerNames[] = $plr->getName();
    }
    $form->addDropdown("Player name:"$PlayerNames);
     
  3. Azonuno

    Azonuno Spider

    Messages:
    11
    thank u so much
     

Share This Page

  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.