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

Refreshsigns dont work

Discussion in 'Development' started by Mystic30, Oct 14, 2017.

  1. Mystic30

    Mystic30 Witch

    Messages:
    52
    GitHub:
    Mystic30
    PHP:
    class RefreshSigns extends PluginTask {
        public 
    $prefix TE::WHITE "-=" TE::REDTE::BOLD "TeamPvP" TE::WHITE "=-";
        public function 
    __construct($plugin)
        {
            
    $this->plugin $plugin;
            
    parent::__construct($plugin);
        }
     
        public function 
    onRun($tick)
        {
            
    $allplayers $this->plugin->getServer()->getOnlinePlayers();
            
    $level $this->plugin->getServer()->getDefaultLevel();
            
    $tiles $level->getTiles();
            foreach(
    $tiles as $t) {
                if(
    $t instanceof Sign) {   
                    
    $text $t->getText();
                    if(
    $text[3]==$this->prefix)
                    {
                        
    $aop 0;
                                            
    $namemap str_replace("§6"""$text[2]);
                        foreach(
    $allplayers as $player){if($player->getLevel()->getFolderName()==$namemap){$aop=$aop+1;}}
                        
    $ingame TE::AQUA "§7[§aJoin§7]";
                        
    $config = new Config($this->plugin->getDataFolder() . "/config.yml"Config::YAML);
                        if(
    $config->get($namemap "PlayTime")!=700)
                        {
                            
    $ingame TE::RED "§7[§4Closed§7]";
                        }
                        elseif(
    $aop>=16)
                        {
                            
    $ingame TE::WHITE "§7[§6Full§7]";
                        }
                                            
    $t->setText($ingame,TE::WHITE  $aop " / 16",$text[2],$this->prefix);
                    }
                }
            }
        }
    }
     
  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.