I have spent 10mins trying to figure it out lol idk maybe it is just my eyes but i cant find the error Code: unexpected '{' in your code on line 49 PHP: <?phpnamespace FlamingGenius\MessageSystem;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\utils\Config;use pocketmine\plugin\PluginBase;use pocketmine\Server;use pocketmine\utils\TextFormat;class main extends PluginBase{public function onEnable(){ $this->saveDefaultConfig();}public function onCommand(CommandSender $sender, Command $command, $label, array $args){ $cmd = $this->command->getName(); $msg = implode(" " , $args); if(strtolower($cmd) == "ms"){ if($args[0] == "broadcast"){ $this->getServer()->broadcastMessage($msg); } elseif($args[0] == "bgod"){ $this->getServer()->broadcastMessage($msg); } elseif($args[0] == "bhero"){ $this->getServer()->broadcastMessage($msg); } elseif($args[0] == "announce"){ $this->getServer()->broadcastMessage($msg); } elseif($args[0] == "server"){ $this->getServer()->broadcastMessage($msg); } elseif($args[0] == "console"){ $this->getServer()->broadcastMessage($msg); } elseif($args[0] == "bcia"){ $this->getServer()->broadcastMessage($msg); } elseif($args[0] == "help"){ $help = $this->getConfig()->get("help-list"); $sender->sendMessage($help); } else($args[0] == " "){ $sender->sendMessage("That is not a configured command"); } }}}?>
Learn how to use an IDE for your code, stop posting useless threads like this one. BTW the error is in the line with the else statement. There shouldn't be parentheses. Please learn PHP. And I think you forgot a closing parentheses.
Use switch() instead of elseif(). It works as if(), but you don't have to check every time the args with elseif()...Its better for command arguments. Thanks - GmWM
He was not asking for suggestions, he was asking if you could find the error. Please read the first post.
I have no clue what you're talking about. Please don't reply if you can't help, because I see you posting random stuff, that have nothing to do with the topic of this thread.
This is more usefull than my topic true? Or this I can recolect your messages in other posts and the 75% is telling: "Learn PHP".
Gamecrafter You see all those users trying to pick fights with you. *continues burning more users* AndrewBit It's because you're so popular HAHA Gamecrafter And you'll definitely lose a fight you pick against me. > Come fight with me Gamecrafter. xDDDD Really you think that this was a 'fight' and I lost the 'fight'? I think that you play too much times Mortal Kombat. *Note: At least I didn't think that 2 comments are a "fight"
If you think/hope that you can't talk anything else after answering the question in the main post, not even to give a reminder, I suggest you to have a thorough body check to confirm that you are a human being not a robot. This is not a forum if you are only having one question and one answer here and nothing else.