Andre\SurvivalGames\Main::onPlayerCommand PHP Method

onPlayerCommand() public method

public onPlayerCommand ( PlayerCommandPreprocessEvent $event )
$event pocketmine\event\player\PlayerCommandPreprocessEvent
    public function onPlayerCommand(PlayerCommandPreprocessEvent $event)
    {
        if (!$this->PlayerIsInGame($event->getPlayer()->getName()) || $event->getPlayer()->isOp() || substr($event->getMessage(), 0, 1) != "/") {
            unset($event);
            return;
        }
        switch (strtolower(explode(" ", $event->getMessage())[0])) {
            case "/kill":
            case "/lobby":
                break;
            default:
                $event->setCancelled();
                $event->getPlayer()->sendMessage("[{$this->getConfig()->get("prefix")}] {$Blocked_Command}");
                break;
        }
        unset($event);
    }