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

How to do an event on a Button?

Discussion in 'Development' started by LewBr, Oct 24, 2017.

  1. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Can anyone give me an example how to do another window when click to a button in a window?
    Please whitout any other plugin like FormAPI, just an example whit this code:
    PHP:
    $handler = new Handler();
                    
    $packet = new ModalFormRequestPacket();
                    
    $packet->formId $handler->getWindowIdFor(Handler::WINDOW);
                    
    $packet->formData $handler->getWindowJson(Handler::WINDOW$this$player$mandar);
                    
    $player->dataPacket($packet);
                    return 
    true;
     
    Example:
    PHP:
           Menu1                                     Menu2
    [click me to go menu2] <player clicksthen  [SendMessage] <player clicksthen $player->sendMessage("hi");
     
  2. friscowz

    friscowz Baby Zombie Ban Evader Banned

    Messages:
    128
    GitHub:
    friscowzmcpe
    i didn't read how those new things called Froms works but i have seen peoples using Packets receiving to get the result.
     
  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.