In this tutorial, you'll learn how to integrate Discord notifications into your FiveM server using a custom resource via the Pterodactyl panel (VolticHost Game Panel). This setup enables your server to send real-time alerts—such as player connections or important events—directly to your Discord channel, keeping you and your community informed. 🚀
📌 Prerequisites
-
A FiveM server purchased at VolticHost.com
-
Pre-installed FiveM with txAdmin, accessible via the VolticHost Game Panel
-
Basic knowledge of Lua scripting and file management
-
A Discord webhook URL (create one in your Discord channel settings under Integrations)
1️⃣ First Step - Creating the Discord Notification Resource
-
Log in to VolticHost Game Panel.
-
Navigate to the File Manager and go to the
/resources/
directory. -
Create a new folder named
discord_notifications
. -
Inside the
discord_notifications
folder, create a new file namedfxmanifest.lua
with the following content:fx_version 'cerulean' game 'gta5' author 'YourName' description 'Discord Notification Integration' version '1.0.0' server_script 'discord_notify.lua'
-
Save the file.
✅ Discord notification resource and manifest created successfully!
2️⃣ Next Step - Uploading the Discord Notification Script
-
In the
discord_notifications
folder, create a new file nameddiscord_notify.lua
. -
Open
discord_notify.lua
for editing and paste the following code:-- discord_notify.lua -- Set your Discord webhook URL here local discordWebhook = "YOUR_DISCORD_WEBHOOK_URL" -- Function to send a notification to Discord function sendDiscordNotification(message) local payload = { content = message } PerformHttpRequest(discordWebhook, function(err, text, headers) if err ~= 200 then print("Discord notification error: " .. tostring(err)) end end, 'POST', json.encode(payload), { ['Content-Type'] = 'application/json' }) end -- Example: Notify when a player connects AddEventHandler('playerConnecting', function(playerName, setKickReason, deferrals) local msg = playerName .. " is connecting to the server." sendDiscordNotification(msg) end) -- Example: Notify when the server starts AddEventHandler('onResourceStart', function(resourceName) if GetCurrentResourceName() == resourceName then sendDiscordNotification("Server resource '" .. resourceName .. "' has started successfully!") end end)
-
Replace
"YOUR_DISCORD_WEBHOOK_URL"
with your actual Discord webhook URL. -
Save the file.
✅ Discord notification script uploaded and configured successfully!
3️⃣ Next Step - Activating the Discord Notification Resource
-
In the Pterodactyl panel, open your
server.cfg
file located in the root directory of your FiveM server. -
Add the following line to ensure your new resource starts with the server:
start discord_notifications
-
Save your changes.
✅ Discord notification resource added to server configuration successfully!
4️⃣ Next Step - Testing and Verifying Discord Notifications
-
Restart your server from the Pterodactyl panel to load the new resource.
-
Join your server and monitor the Discord channel linked to your webhook.
-
Verify that:
-
A notification is sent when a player connects.
-
A message is sent when the resource starts.
-
-
Check the server console for any errors related to the HTTP requests.
✅ Discord notifications tested and functioning correctly!
🎉 Conclusion
You have now successfully integrated Discord notifications with your FiveM server using a custom resource via the Pterodactyl (VolticHost Game) panel! This setup ensures you receive real-time alerts for key events, helping you maintain an informed and responsive server environment. 🚀
For further assistance or advanced customization, contact VolticHost Support.