Опять, помогите пожалуйста, ошибка при вводе команды /zhb. Ядро AquaMine. Mcpe 1.1.5
Code
<?php
namespace MiniApi;
use pocketmine\Player;
use pocketmine\Server;
use pocketmine\plugin\PluginBase;
use pocketmine\command\{Command, CommandSender, ConsoleCommandSender};
use pocketmine\event\Listener;
class Main extends PluginBase implements Listener{
function onEnable(){}
function curl($link){
$c = curl_init($link);
curl_setopt($c, CURLOPT_RETUTNTRANSFER, "true");
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_exec($c);
curl_close($c);}
function sendMessage($id, $msg){
$message = str_replace(" ", "%20", $msg);
$token = "токенгруппы";
$id = "айдичела";
$link = "https://api.vk.com/method/messages.send?user_id=$id&message=$message&acces_token=$token&v=5.130&random_id";
$this->curl($link);}
function onCommand(\pocketmine\command\CommandSender $s, \pocketmine\command\Command $cmd, string $label, array $args) : bool{
if($cmd->getName() === "ls"){
if(!isset($args[0]) or !isset($args[1])){
$s->sendMessage("§7> §fИспользование§7: §e/лс <ник> <сообщение>");
return true;
}
$player = $this->getServer()->getPlayer($args[0]);
if($player == null){
$s->sendMessage("§7> §cЭтот игрок оффлайн");
return true;
}
if(!$s instanceof Player) {
$s->sendMessage("§7> §cНельзя отправить сообщение самому себе");
return true;
}
$player = $this->getServer()->getPlayer($args[0]);
$message = $args[1];
$s->sendMessage("§8(§bВы->{$args[0]}§8)§f: §e{$message}");
$player->sendMessage("§8(§b{$s->getName()}->Вам§8)§f: §e{$message}");
return true;
}
if($cmd->getName() === "zhb"){
if(count($args) !== 2){
$s->sendMessage("§7> §fИспользование§7: §e/жалоба <ник> <причина>");
return true;
}
if(count($args) !== 2){
$name = $s->getName();
$date = date("d.m.y");
$reason = implode(" ", $args);
$text = explode(" ", $reason);
unset($text[0]);
$reason = implode(" ", $text);
$msg = "[{$date}] - Жалоба сервера @vinex_mcpe(Vinex Murder Mystery IP vinex.ddns.net PORT 19135) %0A- Жалуется: {$name} %0A- На игрока: {$args[0]} %0A- Причина: [{$reason}]";
$s->sendMessage("§7> §fВы пожаловались на игрока §a{$args[0]} §fпо причине §e{$reason}\n§7| §fСообщение уже доставлено модератору!");
$this->sendMessage(1, $msg);
return true;
}
}
if($cmd->getName() === "rules"){
$s->sendMessage("§7> §fПрочитать правила можно в нашей группе §bВК §7- §e@vinex_mcpe");
return true;
}
}
}
Ошибка:
An unknown error occurred while attempting to p
erform this command
[23:17:29] [Server thread/CRITICAL]: Unhandled exception executing command 'zhb
1 1' in zhb: Return value of MiniApi\Main::onCommand() must be of the type bool,
none returned
[23:17:29] [Server thread/CRITICAL]: TypeError: "Return value of MiniApi\Main::o
nCommand() must be of the type bool, none returned" (EXCEPTION) in "plugins/Mini
Api/src/MiniApi/Main" at line 73