Can help me ? I don't know is wrong in code.. <?php namespace nycuro; use pocketmine\level\particle\HeartParticle; use pocketmine\level\Position; use pocketmine\level\Location; use pocketmine\math\Vector3; use pocketmine\plugin\PluginBase; use pocketmine\event\player\PlayerMoveEvent; class Main extends PluginBase{ public function spiral(PlayerMoveEvent $event) { $player = $event->getPlayer(); if ($player instanceof Player) { if ($player->getInventory()->getItemInHand()->getId() == 351) { $center = new Vector3(1, 1, 1); $radius = 1; $count = 100; $particle = new HeartParticle($center); for($yaw = 0; $i < $count; $i++){ $pitch = (mt_rand() / mt_getrandmax() - 0.5) * M_PI; $yaw = mt_rand() / mt_getrandmax() * 2 * M_PI; $y = -sin($pitch); $delta = cos($pitch); $x = -sin($yaw) * $delta; $z = cos($yaw) * $delta; $v = new Vector3($x, $y, $z); $p = $center->add($v->normalize()->multiply($radius)); $particle->setComponents($p->x, $p->y, $p->z); $level->addParticle($particle); } } } }
PHP: public function spiral(PlayerMoveEvent $event) {$player = $event->getPlayer();if ($player instanceof Player) { if ($player->getInventory()->getItemInHand()->getId() == 351) { // Center I assume is player position $radius = 1; $count = 100; $particle = new HeartParticle($player); // $yaw is in radians for($yaw = 0, $y = $center->y; $y < $center->y + 2; $yaw += (M_PI * 2) / 20; $y += 1 / 20){ $x = -sin($yaw); $z = cos($yaw); $particle->setComponents($x, $y, $z); $level->addParticle($particle); } }}}
Ehmm, sorry you are not using PocketMine, please look for furthermore help on software's official forums P.S. It's simple PHP syntax error there is nothing to do with PocketMine anyway
http://lmgtfy.com/?q=where can I learn php You either learn PHP and come back if you are able to fix (simple) errors yourself or you don't come back. You simply copied that code without even thinking one second about it. This forum is not there to copy stuff, it's there to learn stuff. Yes, those are two different things. You don't learn from copying. Do you know this one sentence.. Learning by doing.
It is not idle, but do not know so much English and nobody can explain to me what this or that means . @HotFireyDeath