If you are stuck, or run into problems. Just review this and ensure you didn't do anything wrong within the config.
Example Config:
--[[ To open the menu, use /admin (can be changed in the config.lua file). 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. - /f <id> - Toggle freeze on a player. - /s <id> - Summon a player to your location. - /tp <id> - Teleport to a player. - /tpv <id> - Teleport into a player's vehicle. - /ss <id> - Take a screenshot of a player. - /playernames - Toggle player names on/off.]]CONFIG = { DEBUG =false, -- If you want to see debug messages, set this to true. URL ='https://store.hamz.dev/', -- Panel Link, with a "/" at the end of the link SERVER ='YOUR SERVER NAME', -- Server name, this is the same name you entered on the panel TOKEN ='YOUR SECRET KEY', -- 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 DEFAULT_COMMAND ='admin', -- Default command to open the menu 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', SUMMON_PLAYER ='hamzstaff.summonplayer', -- To summon a player TELEPORT_PLAYER ='hamzstaff.teleportplayer', -- To teleport to a player FREEZE_PLAYER ='hamzstaff.freezePlayer', -- To freeze/unfreeze a player TP_IN_PLAYER_VEHICLE ='hamzstaff.teleportinvehicle', -- To teleport into a player's vehicle SCREENSHOT_PLAYER ='hamzstaff.screenshotplayer', -- To screenshot a player IMMUNE_STAFF ='hamzstaff.immune' -- Staff that are immune to staff actions }, 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' }, SUMMON_PLAYER = {'1125449225069666377'}, -- To summon a player TELEPORT_PLAYER = {'1125449225069666377'}, -- To teleport to a player FREEZE_PLAYER = {'1125449225069666377'}, -- To freeze/unfreeze a player TP_IN_PLAYER_VEHICLE = {'1125449225069666377'}, -- To teleport into a player's vehicle SCREENSHOT_PLAYER = {'1125449225069666377'}, -- To screenshot a player IMMUNE_STAFF = {'1125449225069666377'} -- Staff that are immune to staff actions } }, 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" }, KEYBIND = { ENABLED =true, -- If you want to use the keybind to open the menu, set this to true. KEY ='F9' -- Keybind to open the menu (https://docs.fivem.net/docs/game-references/controls/) Use the "Default QWERTY" name. }}CONFIG.OPTIONS = { { actions = { type ='command', action ='playernames' }, name ='player_names', -- This is the name of the option, it is used to save the state of the option title ='Player Names (DISCORD PERMS)', description ='Toggle player names on/off.', args = {}, submit ='Execute', permissions = {'1125449225069666377'} }, { actions = { type ='command', action ='playernames' }, name ='player_names_ace', title ='Player Names (ACE PERMS)', description ='Toggle player names on/off.', args = {}, submit ='Execute', permissions = {'hamzstaff.playernames'} }, { actions = { type ='event', event ='server', action ='admin:invisible' }, name ='invisible', title ='Toggle Cloak', description ='Toggle your visibility.', args = {}, submit ='Execute', permissions = {'1125449225069666377'} }}CONFIG.SCREENSHOT = { SCREENSHOT_RESOURCE_NAME ='screenshot-basic', -- The resource name for the screenshot CLIENT_SCREENSHOT_WEBHOOK ='https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz1234567890', -- Webhook for the client screenshot, make a hidden channel or a channel in another server. Just in case someone abuses it SERVER_SCREENSHOT_WEBHOOK ='https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz1234567890' -- The webhook that is shown to staff, this is the main webhook}
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.
Debug
Set this to true if you are running into issues, that'll help you find exactly what's happening and what might be causing your problem.
URL
Ensure it begins with a "https://" and ends with a "/". SSL is required.
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.
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: https://github.com/JaredScar/Badger_Discord_API
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") thenTriggerClientEvent('chatMessage', -1, '^1[^5SCRIPT ERROR^1] ^3The script ^1' ..GetCurrentResourceName() ..' ^3will not work properly... You must '..'rename the resource to ^1Badger_Discord_API');endlocal 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')endTriggerClientEvent('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)
Keybind
The keybind can be changed by staff in their FiveM settings even if you set it to a certain key.
Screenshot
You'll need screenshot-basic for this, if you renamed it, just change the name here.
Options
This is a new feature of the admin menu, it allows you to add your own custom events and commands. Note, that it is recommended to add additional checks to the provided events/commands.
By default, we give you three custom options (two are the same), invisibility and player names. You can remove one of the player names. One of them uses ACE perms and the other uses Discord roles.
If you set CONFIG.PERMISSIONS.TYPE to ACE, the options will use ACE perms, if you set it to DISCORD, it'll use Discord roles.
This guide explains how to add custom commands and events.
Add these new events/commands into your config, see the above config example.
Adding a command:
To add a new command to your server, follow these steps:
Actions:
Write command for the type .
The action should be the name of your command minus the (/). For instance, for /playernames, set the action to playernames
Command Details:
name: This identifier for your command must be unique and cannot contain spaces. Make sure each option has a different name.
title: The name that will appear in the menu.
description: A brief description of what the command does, this will also appear under the title in the menu.
Configure Args (Optional):
Add additional settings such as inputs or checkboxes. Actions are configured with a type and a sortOrder which determines their order of appearance.
sortOrder: This number indicates the order in which the inputs appear during command configuration.
Here’s an example of different types:
args = { { type ='input-number', title ='Player ID', sortOrder =1 }, { type ='dropdown', title ='Effect', sortOrder =2, args = { {value ='sparkle', label ='Sparkle'}, {value ='flash', label ='Flash'}, {value ='glow', label ='Glow'} } }, { type ='checkbox', title ='Enable effect for all?', sortOrder =3 }, { type ='input-string', title ='Announcement', sortOrder =4 }}
Submit Button:
submit: This is the label on the button used to execute the command, e.g., Apply.
Set Permissions:
permissions: Specify permissions needed to view and execute the command. Use role IDs for Discord permissions or specific strings for ACE permissions. Leave it empty if you want anyone who has permission to open the menu to access this option.
Example configuration for a custom command:
{ actions = { type ='command', action ='showplayernames' }, name ='show_player_names', // Notice no spaces title ='Show Player Names', description ='Toggle visibility of player names.', args = { { type ='input-number', title ='Player ID', sortOrder =1 } }, submit ='Apply', permissions = {'1125449225069666377'}}
Adding a Custom Event
Adding an event is similar to adding a command, with a few distinctions:
Actions:
Use event for the type.
Specify the action as the event name and the event as either server or client.
Event Details:
name: The unique identifier for your event, also cannot contain spaces. Make sure each option has a different name.
Configure Args (Optional):
Include configurations such as inputs:
args = { { type ='input-number', title ='Target ID', sortOrder =1 }}
Submit Button:
submit: Label the button that triggers the event, such as Execute.
Set Permissions:
Define access, in the same way as the commands.
Example configuration for a custom event:
{ actions = { type ='event', action ='server:toggleInvisibility', event ='server' }, name ='toggle_invisibility', // No spaces title ='Toggle Invisibility', description ='Make yourself invisible.', args = { { type ='input-number', title ='Target ID', sortOrder =1 } }, submit ='Trigger', permissions = {}}
By following these instructions, you can effectively add and configure your own commands and events. If any questions arise, feel free to refer back to this guide or create a ticket within our discord.
Your config should now look something like this, of course with your new commands/events.
CONFIG.OPTIONS = { { actions = { type ='command', action ='playernames' }, name ='player_names', title ='Player Names (DISCORD PERMS)', description ='Toggle player names on/off.', args = {}, submit ='Execute', permissions = {'1125449225069666377'} }, { actions = { type ='event', event ='server', action ='admin:invisible' }, name ='invisible', title ='Toggle Cloak', description ='Toggle your visibility.', args = {}, submit ='Execute', permissions = {'1125449225069666377'} }, { actions = { type ='command', action ='setweather' }, name ='set_weather', title ='Change Weather', description ='Allows you to change the current weather on the server.', args = { { type ='dropdown', title ='Weather Type', sortOrder =1, args = { {value ='sunny', label ='Sunny'}, {value ='rain', label ='Rain'}, {value ='fog', label ='Fog'} } } }, submit ='Apply', permissions = {'weather.change'} }, { actions = { type ='event', event ='server', action ='spawnVehicle' }, name ='spawnVehicle', title ='Spawn Vehicle', description ='Spawns a selected vehicle near you.', args = { { type ='input-string', title ='Vehicle Model', sortOrder =1 }, { type ='input-number', title ='Number of Vehicles', sortOrder =2 }, { type ='checkbox', title ='Spawn with Full Fuel?', sortOrder =3 } }, submit ='Spawn', permissions = {'vehicle.spawn'} }}
Shout out to my boy chatgpt for the options guide.