<?php namespace SkyHard; use pocketmine\Player; use pocketmine\Server; use pocketmine\event\player\PlayerInteractEvent; use pocketmine\event\Listener; use pocketmine\plugin\PluginBase; use pocketmine\item\Item; use pocketmine\block\Block; class Main extends PluginBase implements Listener{ public $prefix = "§a»§r§7"; public function onEnable(){ $this->getServer()->getLogger()->info($this->prefix."ativo"); $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onInteract(PlayerInteractEvent $ev){ $player = $ev->getPlayer(); $item = $ev->getItem(); $block = $ev->getBlock(); if($item->getId() == 345){ $closest = "nullbody"; $algo = $event->getName(); foreach($this->getServer()->getOnlinePlayers() as $p){ if($p !== $player){ $x = $p->x - $player->x; $z = $p->z - $player->z; $square = abs($x) + abs($z); if($lastSquare === -1 or $lastSquare > $square){ $closest = $p->getName(); $algo = $event->getName(); $player->sendPopup($this->prefix." §eApontando Para §a".$algo.""); } } } } } }
Por favor, diga os erros para poder entender oque você precisa. Please, tell us the issue or what you want so i can read what you want.
Cake Code: ( ( ( ) ( ) ( ( Y Y ( ) ( ) |"| |"| Y Y | | | | |"| |"| | |.-----| |---.___ | | | | .--| |,~~~~~| |~~~,,,,'-| | | |-,,~~'-'___ '-' ~~| |._ .| |~ // ___ '-',,'. /,'-' <_// // _ __ ~,\ / ; ,-, \\_> <<_' ____________;_) | ; {(_)} _, ._>>`'-._ | | ; '-'\_\/> '-._ | |\ ~,,, _\__ ,,,,,'-. | | '-._ ~~,,, ,,,~~ __.-'~ | | | '-.__ ~~~~~~~~~~~~ __.-' |__| |\ `'----------'` _| | '=._ __.=' | : '=.__ __.=' | \ `'==========='` .' snd '-._ __.-' '-.__ __.-' `'-----------'` [/php] Perhaps next time make clear what your problem is.
Existe algum tipo de erro no Console? Após você clicar no item não aparece popup? qual o erro realmente? Por favor diga os erros reais e coloque PHP: seu código
Este codigo é do meu amigo burro kkkj eu não entendi oq ele estava tentando fazer este codigo é de um amigo ele é mto burro ._. e eu n soube ajuda´lo então pedi ajuda aqui
Por favor, na próxima vez crie um post melhor e mais dedicado, se o problema foi resolvido altere a tag da postagem para [Solved] na opçãozinha ali do lado e obrigado.
[QUOTE = "robske_110 (Tim), post: 40727, membro: 14"] por favor fale inglês aqui [/ QUOTE] animated particles onPlayerMove example or ItemHeld
He has an noob issue on code: like $algo = $event->getName(); but is $algo = $p->getName(); But has been fixed, i think. Have you fixed that? $event->getName() to $p->getName()
[QUOTE = "LewBr, post: 40750, member: 1024"] Ele tem um problema noob no código: como $ algo = $ event-> getName (); mas é $ algo = $ p-> getName (); Mas foi corrigido, penso. Você corrigiu isso? $ event-> getName () para $ p-> getName () [/ QUOTE] si! falei para ele mas não adiantou :V
portugues: Cara, se você não falar inglês aqui, eles vão te banir do FORUM, é melhor falar inglês, sério. inglish: Man, if you don't speak inglish here, they will ban you from FORUM, is best talk inglish, please.
@Hen1 If you really want to speak Portuguese with @LewBr, do it in a DM/Private Conversation or someplace else.