why I can not enter the command / sw join or quit, what happens only raises a message like in the photo?? Code : PHP: case 'join': if (!(count($args) < 0b11)) { $sender->sendMessage(TextFormat::AQUA . '→' . TextFormat::RED . 'Usage: /sw ' . TextFormat::GREEN . 'join [SWname]' . TextFormat::GRAY . ' [PlayerName]'); break; } if (isset($args[0])) { //SW NAME $SWname = TextFormat::clean(array_shift($args)); if (!array_key_exists($SWname, $this->pg->arenas)) { $sender->sendMessage(TextFormat::AQUA . '→' . TextFormat::RED . 'Arena with name: ' . TextFormat::WHITE . $SWname . TextFormat::RED . ' doesn\'t exist'); break; } } else { if ($sender instanceof Player) { foreach ($this->pg->arenas as $a) { if ($a->join($sender, false)) break 2; } $sender->sendMessage(TextFormat::RED . 'No games, retry later'); } break; } $player = TextFormat::clean(array_shift($args)); if (strlen($player) > 0 && $sender instanceof \pocketmine\command\ConsoleCommandSender) { $p = $sender->getServer()->getPlayer($player); if ($p instanceof Player) { if ($this->pg->inArena($p->getName())) { $p->sendMessage(TextFormat::AQUA . '→' . TextFormat::RED . 'You are already inside an arena'); break; } $this->pg->arenas[$SWname]->join($p); } else { $sender->sendMessage(TextFormat::RED . 'Player not found!'); } } elseif ($sender instanceof Player) { if ($this->pg->inArena($sender->getName())) { $sender->sendMessage(TextFormat::AQUA . '→' . TextFormat::RED . 'You are already inside an arena'); break; } $this->pg->arenas[$SWname]->join($sender); } else { $sender->sendMessage(TextFormat::RED . 'Player not found!'); } break; case 'quit': if (!empty($args)) { $sender->sendMessage(TextFormat::AQUA . '→' . TextFormat::RED . 'Usage: /sw ' . TextFormat::GREEN . 'quit'); break; } if ($sender instanceof Player) { foreach ($this->pg->arenas as $a) { if ($a->closePlayer($sender, true)) break; } } else { $sender->sendMessage('This command is only avaible in game'); } break; default: //No option found, usage $sender->sendMessage(TextFormat::AQUA . '→' . TextFormat::RED . 'Usage: /sw [join|quit]'); break; endswitch; return true; } //Searchs for a valid option switch (strtolower(array_shift($args))):
I can't seem to find the problem in the scope of this code. Could you post the full command handler or full switch statement? So we can point you in the right direction? Edit: The message shown in the picture isn't even sent in the code given ...