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

ModalForm is dont work!

Discussion in 'Help' started by NZSigourney, Sep 6, 2021.

  1. NZSigourney

    NZSigourney Silverfish

    Messages:
    23
    GitHub:
    NZSigourney
    I try anything for fix this but it dont work....
    it returned to other public

    PHP:
    public function byMoney($player){
            
    $a $this->getServer()->getPluginManager()->getPlugin("FormAPI");
            
    $f $a->createModalForm(Function (Player $player$d){
                
    $r $d;
                if (
    $r == null) {
                    
    $player->getLevel()->addSound(new GhastSound($player));
                    return 
    $this->choosen($player);
                }
                switch(
    $r){
                    case 
    1:
                        
    $this->ticket($player);
                        break;
                    case 
    2:
                        
    $player->getLevel()->addSound(new DoorSound($player));
                        return 
    $this->reform($player);
                        break;
                }
            });

            
    $f->setTitle($this->a);
            
    $f->setContent("§aTicket For Teleport to MemberV's Mine area\n Only 3500$ for Alway!");
            
    $f->setButton1("ACCEPT");
            
    $f->setButton2("BACK");
            
    $f->sendToPlayer($player);
        }

        public function 
    byCoin($player){
            
    $a $this->getServer()->getPluginManager()->getPlugin("FormAPI");
            
    $f $a->createModalForm(Function (Player $player$d){
                
    $r $d;
                if (
    $r == null) {
                    
    $player->getLevel()->addSound(new GhastSound($player));
                    return 
    $this->choosen($player);
                }
                switch(
    $r){
                    case 
    1:
                        
    $this->ticketCoin($player);
                        break;
                    case 
    2:
                        
    $player->getLevel()->addSound(new DoorSound($player));
                        return 
    $this->reform($player);
                        break;
                }
            });

            
    $f->setTitle($this->a);
            
    $f->setContent("§aTicket For Teleport to MemberV's Mine area\n Only 100 §bMineSuon§cCoin for Alway!");
            
    $f->setButton1("ACCEPT");
            
    $f->setButton2("BACK");
            
    $f->sendToPlayer($player);
        }
     
    Last edited: Sep 6, 2021
  2. NZSigourney

    NZSigourney Silverfish

    Messages:
    23
    GitHub:
    NZSigourney
    byCoin is working buy byMoney is doesnt
     
    Last edited: Sep 9, 2021
  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.