In this tutorial, you'll learn how to create a custom admin menu using Lua and VGUI on your Garry's Mod server via the VolticHost Game Panel. This menu will allow authorized administrators to quickly execute server commands—like restarting the server or accessing ban functions—with an intuitive graphical interface. 🚀
📌 Prerequisites
-
A Garry's Mod server purchased at VolticHost.com
-
Access to the VolticHost Game Panel
-
Basic knowledge of Lua scripting and VGUI elements
-
Admin privileges on your server
1️⃣ First Step - Uploading the Custom Admin Menu Script
-
Log in to VolticHost Game Panel.
-
Navigate to the File Manager from the main dashboard.
-
Go to the
/garrysmod/lua/autorun/client/
directory. -
Create a new file named
admin_menu.lua
. -
Open
admin_menu.lua
for editing and paste the following script:if CLIENT then -- Command to open the admin menu (only for admins) concommand.Add("open_adminmenu", function() if not LocalPlayer():IsAdmin() then chat.AddText(Color(255,0,0), "You are not authorized to use this menu!") return end local frame = vgui.Create("DFrame") frame:SetTitle("Admin Menu") frame:SetSize(300, 200) frame:Center() frame:MakePopup() local restartButton = vgui.Create("DButton", frame) restartButton:SetText("Restart Server") restartButton:Dock(TOP) restartButton:DockMargin(10, 10, 10, 5) restartButton.DoClick = function() RunConsoleCommand("restart") frame:Close() end local banButton = vgui.Create("DButton", frame) banButton:SetText("Open Ban Menu") banButton:Dock(TOP) banButton:DockMargin(10, 5, 10, 5) banButton.DoClick = function() RunConsoleCommand("open_custombanmenu") frame:Close() end local infoLabel = vgui.Create("DLabel", frame) infoLabel:SetText("Admin actions executed here.") infoLabel:Dock(BOTTOM) infoLabel:DockMargin(10, 5, 10, 10) end) end
-
Save the file after editing.
-
Restart your server from the VolticHost Game Panel to load the new client-side script.
✅ Custom admin menu script uploaded and loaded successfully!
2️⃣ Next Step - Testing and Refining Your Admin Menu
-
Join your server and open the in-game console.
-
Type the command:
open_adminmenu
This should open the custom admin menu window.
-
Verify that the menu displays the "Restart Server" and "Open Ban Menu" buttons along with a brief info label.
-
Test each button:
-
Restart Server: Clicking this should execute the
restart
command. -
Open Ban Menu: This should execute the command
open_custombanmenu
(ensure you have a custom ban menu script or command set up to handle this).
-
-
If adjustments are needed (such as changing the layout, colors, or adding more commands), re-open
admin_menu.lua
in the File Manager, edit the script accordingly, and restart your server to apply the changes.
✅ Custom admin menu tested and refined successfully!
🎉 Conclusion
You have now successfully created a custom admin menu on your Garry's Mod server using the VolticHost Game Panel! Enhance your server management by providing a user-friendly interface for executing critical admin commands. 🚀
For more assistance, contact VolticHost Support.