Documentation
  • Discord Server
  • About Us
  • Free Resources
    • Death Screen
      • PS-Dispatch Integration
    • Battlepass
      • Guides
      • Commands
        • Player Commands
        • Admin Commands
      • API
        • Server
    • Garages
      • Guides
        • Creating Interior
        • Creating Garage
        • How to find entity sets (customizations) for interior
  • Paid Resources
    • Elevator Creator V2
      • Installation
      • Accessible code
    • Radar System V2
      • Installation
      • Accessible code
    • Hotels Creator
      • Accessible code
    • Vehicle Shop Creator
      • Accessible code
    • Stocks Market
      • Accessible code
      • [DEV] - Usable Functions
    • Discord Voice Attendance
      • Installation
    • Deathmatch System
      • Installation
        • esx_ambulancejob
        • qb-ambulancejob
        • wasabi_ambulance
        • qbx_medical
        • codem-inventory
        • core_inventory
      • Accessible code
    • Object Creator
      • Dependencies
      • Accessible code
    • Cocaine Labs
      • Dependencies
      • Accessible code
    • Ownable Crafting Tables
      • Dependencies
      • Accessible code
      • Common Problems
    • Evidence System
      • Dependencies
      • Accessible code
      • Installation
      • API
    • Marketplace V2
      • Accessible code
      • Installation
      • Migration from V1
    • EMS Dispatch
      • Sending Dispatch
      • Accessing the Menu
      • Config File
    • Weed Planting
      • Accessible code
      • How to add new strain?
      • How to install
    • Advanced DarkNet System
      • Config
    • Advanced Taxi Job
      • Accessible code
      • Changelog
    • Advanced Gang Creator
      • Accessible code
      • Installation
        • QB Core
        • QBOX Core
      • API
      • FAQ
    • Advanced Private Cameras
      • ESX
        • Items
      • QBCore
        • Items
      • Accessible code
    • Advanced Elevator Creator
      • Accessible code
    • Advanced Ownable Rent Creator
      • SQL
      • ESX
      • QBCore
      • Config File
    • Advanced Job Creator
      • Installation
        • QB CORE
      • Accessible code
    • Advanced Ownable Shops
      • Installation
      • Accessible code
      • SQL
    • Advanced Ped Creator
      • SQL
      • Config File
    • Advanced Promocode Creator
      • Accessible code
      • SQL File
      • Common problems
    • Advanced Safe Zone Creator
      • Config File
    • Turf Wars
      • Ox Inventory
      • Accessible code
      • API
    • Advanced Gas Station Creator
      • Accessible code
    • Advanced Advertisements System
      • SQL File
      • Accessible code
    • Player Manager
      • Installation
      • Accessible code
    • Mechanic Job
      • Installation
      • Accessible code
      • SQL
    • Advanced Radar System
      • Accessible code
      • SQL
    • Crypto Mining
      • Installation
      • Accessible code
      • Items
      • SQL
    • Racing System
      • Accessible code
    • Car Theft
      • Accessible code
    • Advanced Solar Panels
      • Accessible Code
      • SQL
      • ESX
        • Items
      • QBCore
        • Items
    • Pilot Job
      • Accessible Code
      • ESX
        • SQL
      • QBCore
        • Metadata
        • qb-smallresources
      • QBOX
        • Metadata
    • Advanced Ownable Banks
      • Accessible Code
    • Post Office
      • Accessible Code
      • ESX
        • SQL
      • QBCore
        • SQL
      • Exports
    • Weather Sync
      • API
    • Billing System
      • Accessible code
      • SQL
      • Common problems
Powered by GitBook
On this page
  1. Paid Resources
  2. Stocks Market

Accessible code

------------------------------------------------------------------------------------

function SendNotification(message, type)
    if NotificationSystem == "esx" then
        ESX.ShowNotification(message)
    elseif NotificationSystem == "custom" then
        -- Custom notification system implementation here
    end
end

RegisterNetEvent('uniq-stocks:Notify', function(message, messageType)
    SendNotification(message, messageType)
    
    if messageType == "error" then
        hideUI()
        
        if tabletObj then
            DeleteEntity(tabletObj)
            tabletObj = nil
            
            local ped = PlayerPedId()
            ClearPedTasks(ped)
        end
    end
end)

------------------------------------------------------------------------------------
Locale = 'en'

MenuOpenMethod = {
    Type = "target", -- Method to open the menu: "keybind" or "target"
    TargetPedModel = 'a_m_y_business_02', -- Ped model used for interaction (if "target" is enabled)
    TargetPedCoords = vector3(-191.493, -652.965, 40.489), -- Coordinates for placing the interaction ped
    TargetPedHeading = 241.788, -- Heading of the interaction ped
    TargetLabel = "Open Stock Market", -- Interaction label displayed to players
    OpenMenuKey = 167 -- Keybind for opening the menu (default: F6)
}

Stocks = {
    ['NXS'] = {
        code = 'NXS',
        name = 'Nexus Technologies',
        industry = 'IT',
        defaultValue = '1000',
        maxIncrease = 3.33,
        minDecrease = 2.22,
        stockImage = 'https://cdn.leonardo.ai/users/f2f920f9-883e-48ae-9125-096b1a3811ff/generations/b183bf1b-72d5-4789-8d34-573df010f42f/Leonardo_Phoenix_Design_a_sleek_modern_logo_for_Nexus_Technolo_3.jpg'
    },
    ['QNTM'] = {
        code = 'QNTM',
        name = 'Quantum Motors',
        industry = 'CARS',
        defaultValue = '1000',
        maxIncrease = 4.44,
        minDecrease = 3.33,
        stockImage = 'https://cdn.leonardo.ai/users/f2f920f9-883e-48ae-9125-096b1a3811ff/generations/b748dd5e-c66d-4deb-bdac-ea5b4659284c/Leonardo_Phoenix_Design_a_sleek_and_modern_logo_for_Quantum_Mo_3.jpg'
    },
    ['SYNG'] = {
        code = 'SYNG',
        name = 'Synergy Pharmaceuticals',
        industry = 'PHARMA',
        defaultValue = '1200',
        maxIncrease = 3.85,
        minDecrease = 2.75,
        stockImage = 'https://cdn.leonardo.ai/users/f2f920f9-883e-48ae-9125-096b1a3811ff/generations/cee9483c-4d6c-4288-889e-e84cd9658b35/Leonardo_Phoenix_Design_a_modern_sophisticated_logo_for_Synerg_3.jpg'
    },
    ['VTX'] = {
        code = 'VTX',
        name = 'Vertex Energy',
        industry = 'ENERGY',
        defaultValue = '800',
        maxIncrease = 3.95,
        minDecrease = 2.85,
        stockImage = 'https://cdn.leonardo.ai/users/f2f920f9-883e-48ae-9125-096b1a3811ff/generations/67d35c8e-e477-473e-9072-70719d9be679/Leonardo_Phoenix_Design_a_modern_professional_logo_for_the_sto_3.jpg'
    },
    ['ATLAS'] = {
        code = 'ATLAS',
        name = 'Atlas Aerospace',
        industry = 'AVIATION',
        defaultValue = '1500',
        maxIncrease = 3.55,
        minDecrease = 2.65,
        stockImage = 'https://cdn.leonardo.ai/users/f2f920f9-883e-48ae-9125-096b1a3811ff/generations/adc522b0-67c6-4aab-85b3-13edbdf3f261/Leonardo_Phoenix_Design_a_modern_bold_logo_for_Atlas_Aerospace_3.jpg'
    }
}

NotificationSystem = 'custom' -- Notification system to use ("esx", "qb" or "custom"). If "custom", edit the editable.lua file.

RefreshRate = 10 -- Interval (in minutes) at which stock prices will be updated (default: 10 minutes)

TabletProp = `prop_cs_tablet` -- Prop used as the tablet when accessing the stock market

DefaultAvatar = "https://i.ibb.co/rxVh6gG/logo-by-ramzis-uniq.png" -- Default avatar for user profiles

MarketHours = {
    OpenHour = 00, -- Opening hour of the stock market (24-hour format, 0 = midnight)
    CloseHour = 24 -- Closing hour of the stock market (24-hour format, 24 = midnight)
}

AdminGroups = {
    'admin',
    'god'
}

DiscordWebhook = {
    URL = "YOUR_DISCORD_WEBHOOK_URL_HERE", -- Webhook URL for sending notifications to Discord
    BotName = "Stock Market Bot", -- Name of the Discord bot
    Avatar = "https://example.com/bot-avatar.png" -- Avatar URL for the Discord bot
}

Commands = {
    UpdateStock = {
        Name = "updatestock", -- Command name
        Description = "Manually update a stock's price (Admin only)", -- Description of the command
        Arguments = {
            {name = "stockCode", help = "Stock code"}, -- Argument 1: Stock code to update
            {name = "changeAmount", help = "Amount to change the stock price by"} -- Argument 2: Amount of price change
            -- ... more arguments
        },
        RequireAdmin = true -- Restrict this command to admin users
    },
}
------------------------------------------------------------------------------------

function getUserMoney(source)
    local xPlayer = ESX.GetPlayerFromId(source)
    return xPlayer.getMoney()
end

function removeMoney(source, amount)
    local xPlayer = ESX.GetPlayerFromId(source)
    xPlayer.removeMoney(amount)
end

function addMoney(source, amount)
    local xPlayer = ESX.GetPlayerFromId(source)
    xPlayer.addMoney(amount)
end

------------------------------------------------------------------------------------
PreviousStocks MarketNext[DEV] - Usable Functions

Last updated 6 months ago