So i tried but this doesnt work :/ not sure what i did wrong the command is registered but when i try to use it it does nothing PHP: <?phpnamespace FlamingGenius\MessageSystem;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\utils\Config;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;class main extends PluginBase implements Listener{public function onEnable(){ $this->saveDefaultConfig(); $this->getServer()->getPluginManager()->registerEvents($this, $this);}public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){ $command = $cmd->getName(); if($this->getConfig()->get("enabled") == "true"){ if(strtolower($command == "broadcast")){ $this->getServer()->broadcastMessage("broadcastteat"); } } if($this->getConfig()->get("enabled") == "false"){ $sender->sendMessage("Plugin is not enabled"); }}}?>
It should be $cmd->getName(), not $this->$cmd->getName(). Please try to acquire more knowledge of PHP before attempting to make a plugin.
I fixed that and now im getting this in the log Spoiler: Error 2015-09-27 [03:50:49] [Server thread/INFO]: Enabling MessageSystem v1.0.0 2015-09-27 [03:50:49] [Server thread/NOTICE]: RuntimeException: "Argument 1 passed to pocketmine\plugin\PluginManager::registerEvents() must implement interface pocketmine\event\Listener, instance of FlamingGenius\MessageSystem\main given, called in phar:///usr/local/games/minecraft_pe/1232128/104.156.237.182:19152/plugins/phar_MessageSystem_wpkFWG6qBbcY7RE.phar/src/FlamingGenius/MessageSystem/main.php on line 14 and defined" (E_RECOVERABLE_ERROR) in "/src/pocketmine/plugin/PluginManager" at line 698 2015-09-27 [03:50:49] [Server thread/INFO]: Disabling MessageSystem v1.0.0
In the class declaration, you have to add `implements Listener`. And add the use statement for pocketmine\event\Listener.
Already dOne that my plugin commands looks like this PHP: commands: broadcast: usage: /broadcast <msg> description: Broadcast a msg permission: ms.broadcast