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

Make CustomForm

Discussion in 'Development' started by TheKevnSG, Jul 28, 2019.

  1. TheKevnSG

    TheKevnSG Silverfish

    Messages:
    18
    GitHub:
    thekevinsg
    How can I create a custom form
     
  2. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    use FormAPI
     
  3. LousWiteMC

    LousWiteMC Spider

    Messages:
    6
    GitHub:
    LousWiteMC
    you can use https://poggit.pmmp.io/p/FormAPI plugin by jojoe77777

    example code:
    $form = $this->getServer()->getPluginManager()->getPlugin("FormAPI")->createCustomForm(Player $player, $data){
    $result = $data;
    $this->msg = $data[0];
    if($result == null){
    }
    switch($result){
    case 0:
    $this->getServer()->getBroadCastMessage($this->msg);
    break;
    }
    });
    $form->setTitle("Example Title");
    $form->addLabel("Example");
    $form->addInput("Example Button", 0);
    $form->sendToPlayer($player);
    }
     
  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.