From edc2ec0e53440e7e48ab3a193b54002fe8dca903 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 13 May 2022 00:05:50 +0300 Subject: [PATCH] small command fix for default players --- src/API/ConsoleAPI.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/API/ConsoleAPI.php b/src/API/ConsoleAPI.php index 54c4ddbe..4d1eda54 100644 --- a/src/API/ConsoleAPI.php +++ b/src/API/ConsoleAPI.php @@ -245,7 +245,11 @@ class ConsoleAPI{ if(($d1 = $this->server->api->dhandle("console.command.".$cmd, array("cmd" => $cmd, "parameters" => $params, "issuer" => $issuer, "alias" => $alias))) === false or ($d2 = $this->server->api->dhandle("console.command", array("cmd" => $cmd, "parameters" => $params, "issuer" => $issuer, "alias" => $alias))) === false){ - $output = "You don't have permissions to use this command.\n"; + if(in_array(strtolower($cmd), array_keys($this->cmds))){ + $output = "You don't have permissions to use this command.\n"; + }else{ + $output = "Command doesn't exist! Use /help\n"; + } }elseif($d1 !== true and (!isset($d2) or $d2 !== true)){ if(isset($this->cmds[$cmd]) and is_callable($this->cmds[$cmd])){ $output = @call_user_func($this->cmds[$cmd], $cmd, $params, $issuer, $alias);