import { world, Player, system } from '@minecraft/server';
import { Command } from '../../handler';
import { sendPlayerMessage, config } from '../../../config';
import { adminPanel } from '../../gui/adminpanelgui';

export function apHelp(player: Player) {
    sendPlayerMessage(player, `§e§lLifesteal Help Page -- Welcome§r§6
> Show the welcome GUI

> Usage: ${config.prefix}adminpanel

> Aliases: [
    ap
    admingui
    ag
]

> Examples: [
    ${config.prefix}adminpanel
]`);
}

new Command({
    name: 'adminpanel',
    aliases: [
        'ap',
        'ag',
        'admingui'
    ],
    staffOnly: true,
    code: ({ player, args }) => {
        if (player.hasTag(`admin_gui`)) return sendPlayerMessage(player, `§3Close chat to open GUI`);

        sendPlayerMessage(player, `§3Close chat to open GUI`);

        adminPanel(player);
    }
});