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

Modify Plugin

Discussion in 'Plugin Help' started by Howtodoit, Aug 23, 2020.

  1. Howtodoit

    Howtodoit Spider Jockey

    Messages:
    35
    I got Error. How to Solve this problems
    Code:
    Notice: Undefined offset: 286 in /home/mc_51140/15877/plugins/WarZ/src/GunPlus/GunPlus.php on line 134
    Notice: Undefined offset: 286 in /home/mc_51140/15877/plugins/WarZ/src/GunPlus/GunPlus.php on line 137
    [18:53:44] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\server\DataPacketReceiveEvent' to 'WarZ v1.2': Call to undefined function GunPlus\getEntity() on GunPlus\GunPlus
    [18:53:44] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\server\DataPacketReceiveEvent' to 'WarZ v1.2': Call to undefined function GunPlus\getEntity() on GunPlus\GunPlus
    [18:53:44] [Server thread/CRITICAL]: Error: "Call to undefined function GunPlus\getEntity()" (EXCEPTION) in "/WarZ/src/GunPlus/GunPlus" at line 853
    [18:53:44] [Server thread/CRITICAL]: Error: "Call to undefined function GunPlus\getEntity()" (EXCEPTION) in "/WarZ/src/GunPlus/GunPlus" at line 853
    [18:53:44] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\server\DataPacketReceiveEvent' to 'WarZ v1.2': Call to undefined function GunPlus\getEntity() on GunPlus\GunPlus
    [18:53:44] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\server\DataPacketReceiveEvent' to 'WarZ v1.2': Call to undefined function GunPlus\getEntity() on GunPlus\GunPlus
    [18:53:44] [Server thread/CRITICAL]: Error: "Call to undefined function GunPlus\getEntity()" (EXCEPTION) in "/WarZ/src/GunPlus/GunPlus" at line 853
    [18:53:44] [Server thread/CRITICAL]: Error: "Call to undefined function GunPlus\getEntity()" (EXCEPTION) in "/WarZ/src/GunPlus/GunPlus" at line 853
    
     
  2. Howtodoit

    Howtodoit Spider Jockey

    Messages:
    35
    CODE :
    PHP:
    function move ($player,$eid,$damage,$type,$value true)
        {
            
    //$typeは将来使うかもだから一応keep
            
    if (!isset($this->pos[$eid])) return false;
            
    $H $this->pos[$eid];
            
    $F $this->motion[$eid];
            if (
    $value$F->y-=0.00;
            
    $this->pos[$eid] = new Vector3($H->x+$F->x$H->y+$F->y$H->z+$F->z);
            
    $player->level->addParticle(new FlameParticle($H,204,0,0));
            for (
    $K 1$K 4$K++) {
                
    $H = new Vector3($H->x+$F->x/$K$H->y+$F->y/$K$H->z+$F->z/$K);
                if (
    $player->level->getBlock($H)->isSolid()) {
                    
    $this->close($eid);
                    break;
                    return 
    false;
                }
                foreach (
    $player->level>getEntity() as $ent) {
                    if(
    $ent instanceof Zombie) {
                    
    $x $ent->x;
                    
    $y $ent->y;
                    
    $z $ent->z;
                    
    $c = new Vector2($x$z);
                    if ((new 
    Vector2($H->x$H->z))->distance($c) <= 1.2 && $H->y-$ent-><= 2.6 && $H->y-$ent->0) {
                            
    $ev = new EntityDamageByEntityEvent($player$pEntityDamageEvent::CAUSE_ENTITY_ATTACK$damage);
                            
    $p->attack($damage$ev);
                            
    $this->close($eid);
                            }
                    break;
                    return 
    false;
                    }
                    }
                            
                foreach (
    Server::getInstance()->getOnlinePlayers() as $p) {
                    
    $x $p->x;
                    
    $y $p->y;
                    
    $z $p->z;
                    
    $c = new Vector2($x$z);
                    if ((new 
    Vector2($H->x$H->z))->distance($c) <= 1.2 && $H->y-$p-><= 2.6 && $H->y-$p->0) {
                        if(
    $p->getName() != $player->getName()) {
                            
    $d $this->getFinalDamage($p$damage);
                            
    $ev = new EntityDamageByEntityEvent($player$pEntityDamageEvent::CAUSE_ENTITY_ATTACK$d);
                            
    $p->attack($d$ev);
                        }
                        return 
    $this->close($eid);
                    }
                }
            
    Server::getInstance()->getScheduler()->scheduleDelayedTask(new Callback([$this,"move"],[$player,$eid,$damage]),1);
        }
     
  3. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    What's line 134 and 137?
     
  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.