In-Game Configuration - Admin Menu

If you are stuck, or run into problems. Just go over this and make sure you didn't do anything wrong.

Example Config:

--[[
    To open the menu, use /admin.
    You can use commands or buttons within the menu to perform actions against players.

    Commands:

        - /ban <id> <duration> <reason> - Bans a player for a specified duration and reason.
        - /kick <id> <reason> - Kicks a player for a specified reason.
        - /commend <id> <reason> - Commends a player for a specified reason.
        - /warn <id> <reason> - Warns a player for a specified reason.
        - /trustscore <id> - Shows the trustscore of a player.
]]
Config = {
    URL = 'https://hamz.dev/', -- Panel link
    SERVER = 'Your Server Name', -- Server name, this is the same name you entered on the panel
    TOKEN = 'test', -- Same token/secretkey from the config.php
    DISCORD_LINK = 'https://discord.gg/3DDWp6w', -- Discord link
    DISCORD_WEBHOOK = 'https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz1234567890', -- Discord webhook
    DISCORD_IMAGE = '', -- Just for the logs
    PERMISSIONS = {
        TYPE = 'DISCORD', -- 'DISCORD' or 'ACE'
        ACE = {
            BAN_PLAYER = 'hamzstaff.banplayer',
            KICK_PLAYER = 'hamzstaff.kickplayer',
            NOTE_PLAYER = 'hamzstaff.noteplayer',
            COMMEND_PLAYER = 'hamzstaff.commendplayer',
            WARN_PLAYER = 'hamzstaff.warnplayer',
            GET_PLAYERS = 'hamzstaff.getplayers'
        },
        DISCORD = {
            DISCORD_RESOURCE_NAME = 'Badger_Discord_API',
            BAN_PLAYER = {
                '1125449225069666377'
            },
            KICK_PLAYER = {
                '1125449225069666377'
            },
            NOTE_PLAYER = {
                '1125449225069666377'
            },
            COMMEND_PLAYER = {
                '1125449225069666377'
            },
            WARN_PLAYER = {
                '1125449225069666377'
            },
            GET_PLAYERS = {
                '1125449225069666377'
            }
        }
    },
    UI_SETTINGS = {
        SHOW_STAFF = false, -- If you want to show the staff tag in the player info, set this to true.
        SHOW_INFO_TYPE = false -- If you want "Trustscore"/"Playtime" word to be shown in the info type, set this to true.
    },
    TELL_THE_WORLD = {
        BAN = true, -- If you want to tell the world when a player is banned, set this to true. If not only the target player will see the ban message.
        KICK = true, -- If you want to tell the world when a player is kicked, set this to true. If not only the target player will see the kick message.
        COMMEND = true, -- If you want to tell the world when a player is commended, set this to true. If not only the target player will see the commendation.
        WARN = true -- If you want to tell the world when a player is warned, set this to true. If not only the target player will see the warning.
    },
    USE_TX_ADMIN_WARNING = {
        ENABLED = true, -- If you want to use txAdmins warning message, set this to true.
        SHOW_STAFF_NAME = true -- If you want to show the staff name in the warning message, set this to true. If not it will show "Staff Member"
    }
}

Things to be aware of

Below are some things you need to know while configuring the Admin Menu. The configuration is straightforward, but you must be mindful of a few things.

URL

Make sure it begins with a "https://" and ends in a "/"

Server Name

This must be the same name as the one set in your config.php. It must be identical. The panel supports multiple servers, so ensure you put in the right one.

Example:

If you have this in your config.php:

'server_name' => 'Menu Server',

Then your server name would be this in your config.lua:

SERVER = 'Menu Server',

Webhook logs

This logs errors, in the future it'll log more.

UI Settings

SHOW_STAFF—This function shows if a player is a staff member in the player's tab of the admin menu. It does this by checking if the player has logged into the panel.

SHOW_INFO_TYPE - Shows the label in the player's tab of the admin menu.

Tell The World

If any of the values are set to true, this will show the action performed, to everyone in the server.

TxAdmin Warning

This utilises the "monitor" resource found in the server by default and triggers an event to display the TxAdmin warning message when someone is warned.

Credits to the txAdmin for making it, we just trigger the event.

Permissions

Discord Permissions are based on Discord roles and rely on Badger_Discord_API or any other script with the same exports.

Ace permissions work like this:

add_ace group.admin hamzstaff.banplayer allow
add_ace group.staff hamzstaff.banplayer allow
add_ace group.moderator hamzstaff.banplayer allow

add_ace group.admin hamzstaff.kickplayer allow
add_ace group.staff hamzstaff.kickplayer allow
add_ace group.moderator hamzstaff.kickplayer allow

add_ace group.admin hamzstaff.noteplayer allow
add_ace group.staff hamzstaff.noteplayer allow
add_ace group.moderator hamzstaff.noteplayer allow

add_ace group.admin hamzstaff.commendplayer allow
add_ace group.staff hamzstaff.commendplayer allow
add_ace group.moderator hamzstaff.commendplayer allow

add_ace group.admin hamzstaff.warnplayer allow
add_ace group.staff hamzstaff.warnplayer allow
add_ace group.moderator hamzstaff.warnplayer allow

add_ace group.admin hamzstaff.getplayers allow # Allow's player to view the admin menu
add_ace group.staff hamzstaff.getplayers allow # Allow's player to view the admin menu
add_ace group.moderator hamzstaff.getplayers allow # Allow's player to view the admin menu

If you have a large player base, you might get rate limited by Discord, which will prevent users from accessing the Report/Staff Menu.

Discord Resource Name

Case-sensitive. Note not every discord permissions script will work, only the ones that have the same exports as Badger_Discord_API. If you do not know if your discord permissions script has those exports, just download Badger's resource:

If you want to remove the annoying ad's, simply remove this from the server.lua in Badger's resource:

RegisterNetEvent('Badger_Discord_API:PlayerLoaded')
AddEventHandler('Badger_Discord_API:PlayerLoaded', function()
	if (GetCurrentResourceName() ~= "Badger_Discord_API") then 
		TriggerClientEvent('chatMessage', -1, '^1[^5SCRIPT ERROR^1] ^3The script ^1' .. GetCurrentResourceName() .. ' ^3will not work properly... You must '
	.. 'rename the resource to ^1Badger_Discord_API');
	end
	local license = GetIdentifier(source, 'license');
	if (tracked[license] == nil) then 
		tracked[license] = true;
		TriggerClientEvent('chatMessage', source, 
		'^1[^5Badger_Discord_API^1] ^3The Discord API script was created by Badger. You may join his Discord at: ^6discord.gg/WjB5VFz')
	end
	TriggerClientEvent('chatMessage', source, 
		'^7[^2Zap-Hosting^7] ^3Use code ^5TheWolfBadger-4765 ^3at checkout for ^220% ^3off of selected services. Visit ^5https://zap-hosting.com/badger ^3to get started!');
end)

Last updated