This commit is contained in:
GameHerobrine 2022-11-13 00:06:12 +03:00
parent 978447cdbb
commit b30cdd3b2f
8 changed files with 94 additions and 18 deletions

View file

@ -22,10 +22,18 @@ class ConsoleAPI{
$this->register("difficulty", "<0|1|2|3>", [$this, "defaultCommands"]);
$this->register("stop", "", [$this, "defaultCommands"]);
$this->register("defaultgamemode", "<mode>", [$this, "defaultCommands"]);
$this->server->api->ban->cmdWhitelist("help");
$this->server->api->ban->cmdWhitelist("status");
$this->cmdWhitelist("help");
$this->cmdWhitelist("status");
}
/**
* Whitelists a CMD so everyone can issue it - Even non OPs.
* @param string $cmd Command to Whitelist
*/
public function cmdWhitelist($cmd){
$this->server->api->ban->cmdWhitelist[strtolower(trim($cmd))] = true;
}
public function register($cmd, $help, $callback){
if(!is_callable($callback)){
return false;