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
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->y <= 2.6 && $H->y-$ent->y > 0) { $ev = new EntityDamageByEntityEvent($player, $p, EntityDamageEvent::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->y <= 2.6 && $H->y-$p->y > 0) { if($p->getName() != $player->getName()) { $d = $this->getFinalDamage($p, $damage); $ev = new EntityDamageByEntityEvent($player, $p, EntityDamageEvent::CAUSE_ENTITY_ATTACK, $d); $p->attack($d, $ev); } return $this->close($eid); } } Server::getInstance()->getScheduler()->scheduleDelayedTask(new Callback([$this,"move"],[$player,$eid,$damage]),1); }