📈 Pogue StockMarket Script For RedM

Welcome to the Pogue StockMarket Script, a dynamic trading system designed to bring stock and commodity trading to your RedM server.

💬 Support


📜 Overview

The Pogue StockMarket Script allows players to trade stocks and commodities while brokers and special jobs manage commissions. Stock prices update dynamically based on configurations, and all settings are easily adjustable via the config.lua file. Brokers, bankers, and bookmakers play a unique role in the server’s economy, collecting commissions while facilitating trades.


Features

📊 Stock Trading

  • Add any stock or commodity to the system.

  • Real-time stock price updates based on configurable variables.

💰 Player Interaction

  • Players can track stock prices, buy, and sell stocks.

  • Transactions include a configurable commission fee, collected into a pool.

🤝 Broker and Special Jobs System

  • Brokers are exempt from commission fees.

  • Special jobs (e.g., banker, bookmaker) have unique, reduced commission rates.

  • Commissions are accumulated into a pool, which brokers can withdraw at any time.

⚙️ Customization

  • Adjust settings such as stock lists, commission rates, special jobs, and price update intervals via config.lua.

  • Add or remove jobs and define custom commission rates for each job.


🔧 Installation Instructions

1. Add the Script to Your Server

  1. Place the pogue_stockmarket folder into your server's resources directory.

  2. Add the script to your server configuration file (server.cfg):

    ensure pogue_stockmarket

2. Set Up the Database

  1. Run the following SQL files:

    • stock_commodity for VORP.sql: "Items" table for storing commodity details. (If you use RSG, use Items For RSG.txt

    • pogue_stocks.sql: Manages stock names and prices. The "item" column in both SQL tables must have matching names.

    • pogue_broker.sql: Tracks broker commissions.

    • pogue_stocks_price_and_volatility.sql: For stocks and volatility

3. Add Images to VORP Inventory

  1. Copy the images from the img folder in the script.

  2. Paste them into your vorp_inventory/html/img/items directory.

4. Configure Settings

  • Open the config.lua file to adjust:

    • Commission Rate:

      Config.CommissionRate = 0.20 -- 20% commission
    • Broker Job Name:

      Config.BrokerJob = "broker"
    • Special Jobs and Rates:

      Config.SpecialJobs = {
          banker = 0.10,     -- 10% commission for bankers
          bookmaker = 0.15   -- 15% commission for bookmakers
      }
    • Volatility Intervals:

      Config.VolatilityDecreaseInterval = 1200000 -- The time interval for volatility changes (in milliseconds)
      Config.VolatilityMinimum = 1 -- The minimum volatility change (1%)
      Config.VolatilityMaximum = 8 -- The maximum volatility change (8%)
      
      -- If a stock has a volatility of 1, the following variable is applied (until the next volatility change interval)
      Config.VolatilityEffectMin = 10 -- The lowest possible volatility increase (%) 
      Config.VolatilityEffectMax = 15 -- The highest possible volatility increase (%)
      
      Config.PriceMinMultiplier = 0.5 -- Defines the minimum price multiplier relative to the base price (default: 0.5).
      Config.PriceMaxMultiplier = 10  -- Defines the maximum price multiplier relative to the base price (default: 10
      
      -- If you want to allow the price to drop by up to 90% of the base price, you should set the Config.PriceMinMultiplier value to 0.1. This allows the minimum price to be 10% of the base price.
    • Price Update Frequency:

    Config.PriceUpdateInterval = 60000 -- The time interval between price updates (in milliseconds)

🛠️ Requirements

  • VORP Core Framework: Ensure vorp_core is installed and functional.

  • RSG Core Framework: Ensure rsg_core is installed and functional.

  • oxmysql: Required for database integration.


🎮 How It Works

1. Adding Stocks and Commodities

  • Use the SQL tables (stock_commodity.sql and pogue_stocks.sql) to define items and their prices.

  • Ensure that the "item" column in both tables matches the item names in the inventory system.

2. Trading Stocks

  • Players can buy and sell stocks, paying a configurable commission fee.

  • Stock prices update dynamically based on the intervals defined in config.lua.

3. Broker and Special Jobs

  • Brokers:

    • Brokers pay no commission and collect all transaction fees.

  • Special Jobs:

    • Jobs like banker and bookmaker have unique, reduced commission rates.

    • All commissions, regardless of job, are pooled into the broker account.

4. Dynamic Price Updates

  • Stock prices adjust automatically at intervals defined in config.lua, creating a dynamic and immersive trading experience.


📋 Special Considerations

  • Collaborative Economy: Brokers and special jobs like banker and bookmaker provide players with multiple trading options, even when brokers are offline.

  • Customization: Configure the script to suit your server’s economy by adjusting rates, jobs, and update frequencies.

  • Inventory Integration: Ensure item names in SQL tables match those in your inventory system for seamless functionality.


For support or additional resources, join our Discord or visit our Tebex store.

Enjoy the Pogue StockMarket Script and bring an engaging trading system to your server! 📈

Last updated