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

Why does this only execute twice?

Discussion in 'Development' started by DerCooleVonDem, Feb 17, 2021.

  1. DerCooleVonDem

    DerCooleVonDem Spider Jockey

    Messages:
    37
    GitHub:
    Soon
    The Aim is int 100.
    But it counts up to 2 and then resets.
    Why
    PHP:
    if($event->getBlock() instanceof Stone) {
                                if (!
    $fortschritt >= $aim) {
                                    
    $cfg->set($player->getName()."-fortschritt"$fortschritt 1);

                                    
    $player->sendPopup("§aQuest Fortschritt erzielt!");
                                    
    $cfg->save();
                                } else {
                                    
    $cfg->remove($player->getName()."-aim");
                                    
    $cfg->remove($player->getName()."-fortschritt");
                                    
    $this->getLogger()->info("Removed config für ".$player->getName()." Grund: Quest Beedendet Ziel: Quest Vars (OnlyInQuest)");
                                    
    $player->sendPopup("§l§aQuest Geschafft (50 Quest-XP)");
                                    
    $xp $cfg->get($player->getName() . "-XP");
                                    
    $cfg->set($player->getName() . "-XP"$xp 50);
                                    
    $cfg->save();


                                }
                            }
                        break; 
     
    TestDevelopment likes this.
  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.