Skip to content

Commit

Permalink
Adjust the limit of config, configdb command
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlaubb committed Sep 6, 2024
1 parent 1668ea6 commit 344ef5b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
22 changes: 14 additions & 8 deletions ac_BP/src/Functions/chatModel/Commands/moderations/setadmin.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { registerCommand, isPlayer, verifier } from "../../CommandHandler";
import { c, getPLevel, rawstr } from "../../../../Assets/Util";

registerCommand({
name: "setadmin",
description: "Set the admin permission level of a player",
description: "Let a player disconnect directly",
parent: false,
maxArgs: 2,
minArgs: 2,
argRequire: [verifier.isNumber, verifier.isNumber],
executor: (player: Minecraft.Player, args: string[]) => {
const config = c();
config[args[0]] = args[1];
config.save();
}
})
argRequire: [(value) => !!isPlayer(value as string)],
require: (player) => verifier(player, c().commands.tempkick),
executor: async (player, args) => {
const target = isPlayer(args[0]);
const targetNumber = Number(args[1]);
if (getPLevel(target) >= getPLevel(player)) {
player.sendMessage(new rawstr(true, "c").tra("setadmin.toohigh").parse());
} else if ()
},
});
4 changes: 2 additions & 2 deletions ac_BP/src/Functions/chatModel/Commands/settings/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isAdmin, rawstr } from "../../../../Assets/Util";
import { getPLevel, rawstr } from "../../../../Assets/Util";
import { registerCommand } from "../../CommandHandler";
import Dynamic from "../../../Config/dynamic_config";

Expand All @@ -7,7 +7,7 @@ registerCommand(
name: "config",
description: "Dynamc config related commands",
parent: true,
require: (player) => isAdmin(player),
require: (player) => getPLevel(player) >= 3,
},
{
name: "set",
Expand Down
4 changes: 2 additions & 2 deletions ac_BP/src/Functions/chatModel/Commands/settings/configdb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { c, isAdmin, rawstr } from "../../../../Assets/Util";
import { c, getPLevel, rawstr } from "../../../../Assets/Util";
import { registerCommand } from "../../CommandHandler";
import { recoverChanges, commitChanges } from "../../../Config/config_database";

Expand All @@ -7,7 +7,7 @@ registerCommand(
name: "configdb",
description: "Manage config database function",
parent: true,
require: (player) => isAdmin(player),
require: (player) => getPLevel(player) == 4,
},
{
name: "commit",
Expand Down

0 comments on commit 344ef5b

Please sign in to comment.