Home Garry's Mod Setting Up an In-Game Store on a Garry's Mod Server

Setting Up an In-Game Store on a Garry's Mod Server

Last updated on Feb 13, 2025

In this tutorial, you'll learn how to create an in-game store where players can browse and purchase items using real money. We'll build a simple store UI with Lua and integrate it into your server using the VolticHost Game Panel. 🚀


📌 Prerequisites

  • A Garry's Mod server purchased at VolticHost.com

  • Access to the VolticHost Game Panel

  • Basic knowledge of Lua scripting and Derma UI creation

  • Item details and pricing for your in-game store


1️⃣ First Step - Creating the In-Game Store UI

  1. Log in to VolticHost Game Panel.

  2. Navigate to the File Manager and go to the /garrysmod/lua/autorun/client/ directory.

  3. Create a new file named store_ui.lua.

  4. Open store_ui.lua for editing and paste the following code snippet:

    local frame = vgui.Create("DFrame")
    frame:SetTitle("In-Game Store")
    frame:SetSize(400, 300)
    frame:Center()
    frame:MakePopup()
    
    local itemList = vgui.Create("DListView", frame)
    itemList:Dock(FILL)
    itemList:AddColumn("Item")
    itemList:AddColumn("Price")
    itemList:AddLine("Golden Sword", "$5.99")
    itemList:AddLine("Mystic Shield", "$3.99")
    
  5. Save the file.

  6. Restart your server to load the new client-side script.

Store UI created and loaded successfully!


2️⃣ Next Step - Adding a Command to Open the Store

  1. In the same store_ui.lua file, add a console command to open the store UI:

    concommand.Add("open_store", function(ply)
        if IsValid(frame) then
            frame:Show()
        end
    end)
    
  2. Save the changes.

  3. Restart your server from the VolticHost Game Panel.

  4. Test the command by typing open_store in the console while in-game.

In-game store command added and tested successfully!


🎉 Conclusion

You have now successfully set up an in-game store on your Garry's Mod server using the VolticHost Game Panel! Customize your store further by adding more items and features to enhance the player experience. 🚀

For more assistance, contact VolticHost Support.


Integrating Payment Gateways for Real Money Transactions on a Garry's Mod Server

In this tutorial, you'll learn how to integrate a payment gateway (such as PayPal or Stripe) with your in-game store, allowing players to spend real money securely on your Garry's Mod server. We'll cover setting up a webhook and configuring your server to communicate with your payment provider via the VolticHost Game Panel. 🚀


📌 Prerequisites

  • A Garry's Mod server purchased at VolticHost.com

  • Access to the VolticHost Game Panel

  • An account with a payment gateway (e.g., PayPal, Stripe)

  • A valid webhook URL from your payment provider

  • Basic knowledge of webhooks and server configuration


1️⃣ First Step - Setting Up Your Payment Gateway Webhook

  1. Log in to your payment gateway account (e.g., PayPal or Stripe).

  2. Navigate to the webhook settings and create a new webhook.

  3. Enter the following URL as the endpoint for notifications:

    https://panel.voltichost.com/webhooks/payment
    
  4. Configure the webhook to send notifications for successful transactions to this endpoint.

  5. Save your webhook settings in your payment gateway dashboard.

Payment gateway webhook set up successfully!


2️⃣ Next Step - Configuring Your Server for Payment Integration

  1. Log in to VolticHost Game Panel.

  2. Navigate to the File Manager and open the configuration file for your in-game store (e.g., store_config.cfg) in the /garrysmod/cfg/ directory.

  3. Add your payment gateway webhook URL in the configuration file:

    payment_webhook "https://panel.voltichost.com/webhooks/payment"
    
  4. Save the configuration file.

  5. Restart your server from the control panel to apply the new payment integration settings.

Server configured for payment integration successfully!


🎉 Conclusion

You have now successfully integrated a payment gateway for real money transactions on your Garry's Mod server using the VolticHost Game Panel! This setup allows players to make secure purchases directly through your in-game store, enhancing their gaming experience. 🚀

For more assistance, contact VolticHost Support.