Viority Development
DiscordShop
  • 🏠Home
    • Welcome
    • FAQ
    • Common issues
  • Tutorials
    • βš™οΈProduct
      • How to get the Security Token?
      • How to create new locales?
      • getSharedObject Deprecated
  • 🀝Support
    • Support Policy
    • πŸ‡ΊπŸ‡ΈTicket Rules (EN)
    • πŸ‡©πŸ‡ͺTicket Rules (GER)
  • Products
    • πŸ”’Viority Script Lock
      • How to use
      • JavaScript example
      • Lua example
    • πŸ“‹Viority Advanced Menu
      • πŸ‘€Config Preview
      • Event Command
      • NotifyBoard
      • OpenMenu Event
      • CloseMenu Event
      • UpdateChallengeProgress
      • UpdateAchievementProgress
      • CheckAchievementProgress
      • CheckCurrentLevel
    • 🚘Viority Garage V2
      • πŸ‘€Config Preview
      • OpenGarage Event
      • CloseGarage Event
      • VehicleParkIn
      • VehicleParkIn DV
    • πŸš—Viority Cardealer
      • πŸ‘€Config Preview
      • Vehicle Color Fix
      • OpenCardealer Event
      • CloseCardealer Event
      • UpdateLeasingStatus
      • CheckPlate
      • CheckPlateBlacklist
      • GeneratePlate
    • β›½Viority Gasoline
      • πŸ‘€Config Preview
      • OpenGasoline Event
      • CloseGasoline Event
      • RefillFuelStock
      • GetFuel
      • SetFuel
    • πŸ’³Viority Billingmenu
      • πŸ‘€Config Preview
      • OpenBillingMenu Event
      • CloseBillingMenu Event
    • πŸ’Viority Marry
      • Page
      • πŸ‘€Config Preview
      • StartAnimation Event
      • StopAnimation Event
    • πŸ“ŠViority HUD
      • πŸ‘€Config Preview
        • PMA-Voice Example
        • Saltychat Example
      • Announce Command
      • TriggerNotifySystem
      • UpdateWantedStars
      • UpdateTransactionData
      • UpdateCurrentMission
      • GetWantedStars
    • πŸ•Viority Playtime Rewards
      • πŸ‘€Config Preview
      • ClosePlaytimeReward
      • OpenPlaytimeReward
      • CheckCurrentLevel
    • 🀝Viority Interaction
      • πŸ‘€Config Preview
      • ESX Interaction Integration
      • How to use
    • πŸ†”Viority SupportID
      • πŸ‘€Config Preview
      • getNearestPlayerID
      • getPlayerID
    • πŸ“Viority Register
      • πŸ‘€Config Preview
      • getAllPromocodes
      • getPlayerPromocode
    • 🏒Viority Fraction Request
      • πŸ‘€Config Preview
    • 🌐Viority LifeInvader
      • πŸ‘€Config Preview
    • πŸ””Viority LifeInvader Notify
      • πŸ‘€Config Preview
      • Notify
    • πŸͺ™Viority Trading
      • πŸ‘€Config Preview
      • OpenTradingMenu Event
      • CloseTradingMenu Event
  • πŸ“ŒDiscord Server
Powered by GitBook
On this page
  • Viority Trading Config
  • Viority Trading Locales
  1. Products
  2. Viority Trading

Config Preview

πŸ”§ See the current config files

Viority Trading Config

ViorityCore.lua
--- @diagnostic disable: duplicate-set-field, undefined-field, inject-field
ViorityLocales = {} -- Do not touch this!
ViorityCore = {} -- Do not touch this!

-- Version Notification
ViorityCore.VersionNotification = {
    ['activate'] = false, -- Activate the Version Notification
    ['webhook'] = "https://canary.discord.com/api/webhooks/XXX/XXX", -- Change the Webhook for the Version Notification
}

-- Activate the Debug modus to identify a bug in the code
ViorityCore.DebugMode = false

-- Basic Settings
ViorityCore.InternalPrefix = 'viority_trading:' -- The Internal Trigger Prefix | Attention you have to change any integrations in other scripts!
ViorityCore.EventWrongToken = function(source) -- This happens when a player tried to trigger an event with the wrong token! Most likely, it will be a cheater who tries to gain unfair advantages through serverside events.
    -- You can implement a ban system here!
    DropPlayer(source, "❀️ Do not try to cheat on our server!")
end
ViorityCore.Locales = 'de' -- Choose your Language (de or en) | You can add more in the locales folder!
ViorityCore.OS = 'windows' -- Choose your OS (windows or linux)
ViorityCore.GiveCredits = true -- Give Credits to Viority <3
ViorityCore.NativeInteraction = false -- If you want to use the Native Interaction in bridge instead of our Interaction. Attention this will increase the client-performance!

ViorityCore.Notify = function(message)
    print(message) -- Print the Message in the Console (for Debugging)
    TriggerEvent("viority_hud:client:Notify", 1, 1, "XXX", message) -- Use the Viority HUD Notification System
end

-- Viority Trading
ViorityCore.MainColor = '#6b79f0' -- Change the Main Color of the Trading (Valid HexCode)
ViorityCore.BackgroundColor = '#1F2229' -- Change the Background Color of the Trading (Valid HexCode)
ViorityCore.OpenDefaultKey = 'e'
ViorityCore.PriceFormat = {
    Symbol = '$',
    BehindNumbers = true
}

-- Discord Webhook
ViorityCore.DiscordWebhook = {
    WebhookOrderSuccess = 'https://discord.com/api/webhooks/XXX/XXX', -- Change the Webhook

    WebhookAuthor = 'Viority Trading', -- Change the Author of the Webhook
    WebhookIconURL = 'https://i.ibb.co/0Mnp3Ch/Logo-with-background.jpg', -- Change the IconURL of the Webhook

    WebhookWithIdentifiers = true -- If you want to send the Identifiers data with the Webhook
}

-- Account Mugshot
ViorityCore.AccountMugshot = {
    activate = true, -- Activate the MugShot System (true or false)
    resource = 'loaf_headshot_base64' -- We recommend using the "loaf_headshot_base64" resource. Download it here: https://github.com/loaf-scripts/loaf_headshot_base64. Thanks to Loaf Scripts for this awesome resource ❀️
}

-- Request real-time data (Stocks & Cryptos prices, volume, etc.)
ViorityCore.LiveData = {
    PolygonKey = 'ENTER_YOUR_KEY', -- Your Polygon API Key (Create it free here: https://polygon.io/)
    Multiplicator = 1, -- Multiplicator for the Price (1 = Real Price, 2 = Real Price * 2, 0.5 = Real Price / 2 etc.)
}
ViorityCore.DeactivateLiveData = false -- Deactivate the Live Data System (true or false) | ℹ️ The price will generated by our system, and not by the real-time data! This use the min, max attributes in the investments!

ViorityCore.Investments = {
    ['TSLA'] = { -- ID of the Investment (Should be unique and valid!)
        name = 'Tesla', -- Name of the Investment
        logo = 'https://i.ibb.co/vVVNGKk/tesla.png', -- Link to the Logo of the Investment
        type = 'stock', -- [stock or crypto]
        manually = { -- Set ViorityCore.DeactivateLiveData to true to use this
            minPrice = 100, -- Minimum Price of the Investment
            maxPrice = 1000, -- Maximum Price of the Investment
        }
    },

    ['NVDA'] = {
        name = 'Nvidia',
        logo = 'https://upload.wikimedia.org/wikipedia/sco/thumb/2/21/Nvidia_logo.svg/1200px-Nvidia_logo.svg.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['AAPL'] = {
        name = 'Apple',
        logo = 'https://assets.stickpng.com/images/580b57fcd9996e24bc43c516.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['AMZN'] = {
        name = 'Amazon',
        logo = 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Amazon_icon.svg/2500px-Amazon_icon.svg.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['GOOGL'] = {
        name = 'Alphabet',
        logo = 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Google_%22G%22_logo.svg/1024px-Google_%22G%22_logo.svg.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['MSFT'] = {
        name = 'Microsoft',
        logo = 'https://i.ibb.co/FnZ5kV9/microsoft.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['META'] = {
        name = 'Meta',
        logo = 'https://1000logos.net/wp-content/uploads/2021/10/logo-Meta.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['NFLX'] = {
        name = 'Netflix',
        logo = 'https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/227_Netflix_logo-512.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['JPM'] = {
        name = 'JPMorgan Chase',
        logo = 'https://logos-world.net/wp-content/uploads/2020/11/Chase-Emblem.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['V'] = {
        name = 'Visa',
        logo = 'https://i.ibb.co/k2tJfrb/visa.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['WMT'] = {
        name = 'Walmart',
        logo = 'https://purepng.com/public/uploads/large/purepng.com-walmart-logologobrand-logoiconslogos-251519939045oqelv.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['BABA'] = {
        name = 'Alibaba',
        logo = 'https://i.ibb.co/NL2rGnM/alibaba.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['T'] = {
        name = 'AT&T',
        logo = 'https://i.ibb.co/Wnv6sWP/t.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['PG'] = {
        name = 'Procter & Gamble',
        logo = 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Procter_%26_Gamble_logo.svg/1024px-Procter_%26_Gamble_logo.svg.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['KO'] = {
        name = 'Coca-Cola',
        logo = 'https://i.pinimg.com/originals/1e/c1/d2/1ec1d2ce366d1f603b1bde70ae508063.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['PEP'] = {
        name = 'PepsiCo',
        logo = 'https://i.pinimg.com/originals/e1/05/d7/e105d7fa53f28b0f21d08ac19f63edd9.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['DIS'] = {
        name = 'Disney',
        logo = 'https://static.vecteezy.com/system/resources/thumbnails/022/636/380/small_2x/disney-logo-disney-icon-transparent-free-png.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['MCD'] = {
        name = 'McDonalds',
        logo = 'https://upload.wikimedia.org/wikipedia/commons/thumb/3/36/McDonald%27s_Golden_Arches.svg/2339px-McDonald%27s_Golden_Arches.svg.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['INTC'] = {
        name = 'Intel',
        logo = 'https://i.ibb.co/SnbP1Rk/intel.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['IBM'] = {
        name = 'IBM',
        logo = 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/IBM_logo.svg/2560px-IBM_logo.svg.png',
        type = 'stock',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    -- Cryptos
    ['BTC'] = {
        name = 'Bitcoin',
        logo = 'https://cryptologos.cc/logos/bitcoin-btc-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['ETH'] = {
        name = 'Ethereum',
        logo = 'https://cryptologos.cc/logos/ethereum-eth-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['XRP'] = {
        name = 'XRP',
        logo = 'https://cryptologos.cc/logos/xrp-xrp-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['ADA'] = {
        name = 'Cardano',
        logo = 'https://cryptologos.cc/logos/cardano-ada-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['DOGE'] = {
        name = 'Dogecoin',
        logo = 'https://cryptologos.cc/logos/dogecoin-doge-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['LTC'] = {
        name = 'Litecoin',
        logo = 'https://cryptologos.cc/logos/litecoin-ltc-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['LINK'] = {
        name = 'Chainlink',
        logo = 'https://cryptologos.cc/logos/chainlink-link-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['XLM'] = {
        name = 'Stellar',
        logo = 'https://cryptologos.cc/logos/stellar-xlm-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['DOT'] = {
        name = 'Polkadot',
        logo = 'https://cryptologos.cc/logos/polkadot-new-dot-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['UNI'] = {
        name = 'Uniswap',
        logo = 'https://cryptologos.cc/logos/uniswap-uni-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['USDT'] = {
        name = 'Tether',
        logo = 'https://cryptologos.cc/logos/tether-usdt-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['XMR'] = {
        name = 'Monero',
        logo = 'https://cryptologos.cc/logos/monero-xmr-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['EOS'] = {
        name = 'EOS',
        logo = 'https://cryptologos.cc/logos/eos-eos-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['XTZ'] = {
        name = 'Tezos',
        logo = 'https://cryptologos.cc/logos/tezos-xtz-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['ATOM'] = {
        name = 'Cosmos',
        logo = 'https://cryptologos.cc/logos/cosmos-atom-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['VET'] = {
        name = 'VeChain',
        logo = 'https://cryptologos.cc/logos/vechain-vet-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['THETA'] = {
        name = 'Theta',
        logo = 'https://cryptologos.cc/logos/theta-theta-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['XEM'] = {
        name = 'NEM',
        logo = 'https://cryptologos.cc/logos/nem-xem-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['AAVE'] = {
        name = 'Aave',
        logo = 'https://cryptologos.cc/logos/aave-aave-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['SNX'] = {
        name = 'Synthetix',
        logo = 'https://cryptologos.cc/logos/synthetix-network-token-snx-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['MKR'] = {
        name = 'Maker',
        logo = 'https://cryptologos.cc/logos/maker-mkr-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['TRX'] = {
        name = 'Tron',
        logo = 'https://cryptologos.cc/logos/tron-trx-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['FET'] = {
        name = 'Fetch.ai',
        logo = 'https://cryptologos.cc/logos/fetch-fet-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    },

    ['OSMO'] = {
        name = 'Osmosis',
        logo = 'https://cryptologos.cc/logos/osmosis-osmo-logo.png',
        type = 'crypto',
        manually = {
            minPrice = 100,
            maxPrice = 1000,
        }
    }
}

ViorityCore.StockExchange = {
    -- Ped Models: https://docs.fivem.net/docs/game-references/ped-models/
    -- Coordinates: X - Y - Z
    -- Heading: Specific Direction (0Β° - 360Β°)

    {
        id = 'maze_bank', -- unique id
        ped = {
            model = "a_m_m_business_01",
            pos = vector3(-51.4270, -798.9736, 43.2251),
            heading = 313.5262,
            radius = 3.0
        },
        blip = {
            pos = vector3(-51.4270, -798.9736, 43.2251),
            name = "Stock Exchange",
            sprite = 500,
            color = 3,
            scale = 0.9
        }

    }

}

Viority Trading Locales

Reminder: You can create your own locale file in your language πŸ‘Œ

en.lua
ViorityLocales['en'] = {

    -- Keybind
    ['keybind_open_trading'] = 'Open the stock exchange',

    -- NUI
    ['nui_header_head'] = 'TRADING SYSTEM',
    ['nui_header_desc'] = 'Buy, sell, and invest in stocks and cryptocurrencies',
    ['nui_account_head'] = 'Trading Account',

    ['nui_market_head'] = 'INVESTMENT MARKET',
    ['nui_market_desc'] = 'Current investment opportunities and their prices',
    ['nui_market_button_stock'] = 'STOCK MARKET',
    ['nui_market_button_crypto'] = 'CRYPTO MARKET',

    ['nui_market_entry_pchange'] = '% CHANGE',
    ['nui_market_entry_change'] = 'CHANGE',
    ['nui_market_entry_price'] = 'PRICE PER ONE',
    ['nui_market_entry_volume'] = 'VOLUME',
    ['nui_market_entry_buy'] = 'BUY',

    ['nui_chart_head'] = 'PRICES CHART',
    ['nui_chart_tooltip_price'] = 'Price',

    ['nui_portfolio_head'] = 'YOUR PORTFOLIO',
    ['nui_portfolio_desc'] = 'Your current investments and their value',
    ['nui_portfolio_search_head'] = 'SEARCH INVESTMENT',
    ['nui_portfolio_search_placeholder'] = 'Search...',

    ['nui_portfolio_entry_pprofit'] = '% PROFIT',
    ['nui_portfolio_entry_profit'] = 'PROFIT',
    ['nui_portfolio_entry_worth'] = 'CURRENT WORTH',
    ['nui_portfolio_entry_amount'] = 'AMOUNT',
    ['nui_portfolio_entry_sell'] = 'SELL',

    ['nui_order_buy_stock'] = 'STOCK ORDER',
    ['nui_order_buy_crypto'] = 'CRYPTO ORDER',
    ['nui_order_sell_stock'] = 'STOCK SELL',
    ['nui_order_sell_crypto'] = 'CRYPTO SELL',
    ['nui_order_loading'] = 'WeΒ΄re process your order',

    ['nui_order_wallet_money'] = 'MONEY WALLET',
    ['nui_order_wallet_bank'] = 'BANK WALLET',
    ['nui_order_button_complete'] = 'COMPLETE',

    -- Order Callback Messages
    ['nui_order_success_S01'] = 'The Order was succesfully!',
    ['nui_order_failed_F01'] = 'The Order was failed (Invalid Data)!',
    ['nui_order_failed_F02'] = 'The Order was failed (xPlayer Invalid)!',
    ['nui_order_failed_F03'] = 'The Order was failed (Investment Invalid)!',
    ['nui_order_failed_F04'] = 'The Order was failed (Price Change)!',
    ['nui_order_failed_F05'] = 'The Order was failed (Order Type Invalid)!',
    ['nui_order_failed_F06'] = 'The Order was failed (Not enough in portfolio)!',
    ['nui_order_failed_F07'] = 'The Order was failed (Not enough money)!',

    -- Interaction
    ["nui_interaction_press"] = "PRESS",
    ["nui_interaction_open"] = "TO INTERACT",

}
PreviousViority TradingNextOpenTradingMenu Event

Last updated 1 year ago

πŸͺ™
πŸ‘€