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
------------------------------------------------------------------------------------
Last updated