hello I would like to know if there a way that when I press a cartel run a command on the console. Please let me help you in your code.
In this forum you need to talk english...everyone need to do it...if you want to talk it. Go in the appropriate section or by PM -non possiamo parlare in italiano a meno che non sia un messaggio privato o che siamo nella sezione del forum italiana Cmq ha capito
ciao italiani PHP: <?phpnamespace xXx;use pocketmine\command\Command;use pocketmine\event\Listener;use pocketmine\Player;use pocketmine\plugin\PluginBase;use pocketmine\Server;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\event\block\BlockBreakEvent;use pocketmine\event\Event;use pocketmine\event\player\PlayerInteractEvent;use pocketmine\level\Level;use pocketmine\item\Block;class xXx extends PluginBase implements Listener{ public function onLoad(){} public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function playerBlockTouch(PlayerInteractEvent $event){ $player = $event->getPlayer(); $block = $event->getBlock()->getID(); if($block == 323 || $block == 63 || $block == 68){ //run command... } } public function onDisable(){ }}
Xionbig attualmente ne conto 5 XD I think there are only 5 italians...mean this...not the same translation but...xD
missing syntax to run the command, now I will try in the documentation manca la sintassi per eseguire il comando, adesso cercherò nella documentazione
needs to be more signs then Code: public function eventHandle($data, $event) { if (isset($this->picked[$data["player"]->username])) { $block = $data["target"]; $read = $this->api->plugin->readYAML($this->api->plugin->configPath($this). "blocks.yml"); $x = $block->x; $y = $block->y; $z = $block->z; $level = $block->level->getName(); $id = $x . "!" . $y . "!" . $z . "!" . $level; $read[$id][] = $this->picked[$data["player"]->username];