Merge pull request #9 from GameHerobrine/test

Command execution fix for default players
This commit is contained in:
ArkQuark 2022-05-13 00:08:47 +03:00 • committed by GitHub
commit d18d30920f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);