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

superBAR plugin error

Discussion in 'Plugin Help' started by iChaoticSoldier, Feb 27, 2017.

  1. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    Hi can anyone fix this error keep showing in console but in the game the message from superbar dont work please help

    [​IMG] http://imgur.com/pNxNwEv

    Heres the code
    PHP:
    <?PHP
    namespace FaigerSYS\superBAR;
    use 
    pocketmine\scheduler\PluginTask;

    class 
    hotBAR extends PluginTask {
        public 
    $serv$eT$noF$ppup$CASH$FACT$FT_v$GP$GT$PP$PP_v$KD$FRMT$PFM$TIME_FRMT;
        public 
    $ADNS = array('%NICK%''%MONEY%''%FACTION%''%ITEM_ID%''%ITEM_META%''%TIME%''%ONLINE%''%MAX_ONLINE%''%X%''%Y%''%Z%''%IP%''%PP_GROUP%''%TAG%''%LOAD%''%TPS%''%KILLS%''%DEATHS%''%LEVEL%''%PING%''%GT%''%AGT%');
        public 
    $ADNE = array();
        public 
    $VR = array();
       
        public function 
    ddts($tz) {
            if (
    $tz)
                
    date_default_timezone_set($tz);
        }
       
        public function 
    onRun($tick) {
            
    $fact $ppg $cash $kll $dth $png $gt $agt '§cNoPlug';
            
    $load $this->serv->getTickUsage();
            
    $tps $this->serv->getTicksPerSecond();
            
    $plon count($this->serv->getOnlinePlayers());
            
    $mxon $this->serv->getMaxPlayers();
            
    $ADNS $this->ADNS;
            
    $ADNE $this->ADNE;
            
    $VR $this->VR;
            
    $a $id $mt 0;
            foreach (
    $this->serv->getOnlinePlayers() as $p) {
                if (
    $p != null) {
                    
    $name $p->getName();
                    if (
    $this->PP) {
                        if (
    $this->PP_v 1.2)
                            
    $ppg $a $this->PP->getUser($p)->getGroup()->getName();
                        else
                            
    $ppg $a $this->PP->getUserDataMgr()->getData($p)['group'];
                    }
                   
                    if (
    $this->FACT) {
                        if (
    $this->FT_v 1.5)
                            
    $fact $this->FACT->getPlayerFaction($name);
                        else
                            
    $fact $this->FACT->getSessionFromName($name)->getFactionName();
                        if (
    count($fact) == 0)
                            
    $fact $this->noF[$a];
                    }
                   
                    if (
    $this->eT == 1)
                        
    $cash $this->CASH->myMoney($name);
                    elseif (
    $this->eT == 2)
                        
    $cash $this->CASH->getMoney($name);
                   
                    if (
    $this->KD) {
                        
    $kll $this->KD->getKills($name);
                        
    $dth $this->KD->getDeaths($name);
                    }
                   
                    if (
    $this->GT) {
                        
    $gt $this->GT->getSessionTime($name'%i%:%s%');
                        
    $agt $this->GT->getAllTime($name'%H%:%i%:%s%');
                    }
                   
                    if (
    $this->GP)
                        
    $png $this->GP->getPing($name);
                   
                    if (
    $p->getInventory() != null) {
                        
    $id $p->getInventory()->getItemInHand()->getId();
                        
    $mt $p->getInventory()->getItemInHand()->getDamage();
                    }
                   
                    
    $ADNG = [];
                    foreach (
    $ADNE as $file) {
                        require(
    $file);
                        
    array_push($ADNG$onExecute($p$VR[$file]));
                    }
                   
                    
    $text str_replace($ADNSarray_merge(array($name$cash$fact$id$mtdate($this->TIME_FRMT[$a]), $plon$mxonintval($p->x), intval($p->y), intval($p->z), $p->getAddress(), $ppg$p->getNameTag(), $load$tps$kll$dth$p->getLevel()->getName(), $png$gt$agt), $ADNG), $this->FRMT[$a]);
                    if (
    $this->ppup[$a])
                        
    $p->sendPopup($text);
                    else
                        
    $p->sendTip($text);
                }
            }
        }
    }
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    If you want to post an image from imgur as the image and not as like, make sure to either use imgurs bb code or copy the image url (not the webpage url) and use the inage button above.

    For the plugin, try removing this part of the code:
    PHP:
                    if ($this->FACT) {
                        if (
    $this->FT_v 1.5)
                            
    $fact $this->FACT->getPlayerFaction($name);
                        else
                            
    $fact $this->FACT->getSessionFromName($name)->getFactionName();
                        if (
    count($fact) == 0)
                            
    $fact $this->noF[$a];
                    }
                   
     
  3. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    Well i tried it but the error still persist
     
  4. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    Undefined variable = $p
     
  5. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    Code:
    $p = getPlayer()->getName()
     
  6. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Idk what you're looking at, but $p is defined as each entry of an array of online players. Plus, there is an if statement checking if the player is not null to prevent issues.
     
  7. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    Didn't spot it XD thanks Cory :D
     
  8. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    You're using old superBAR!
     
  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.