A FiveM Script (that actually utilizes the real stock market, pretty nifty)
What is it?
BadgerStockMarket is a stock market that is based on the real stock market! The prices and graphs actually come from the real stock market! I wanted to make a nifty script to interact with the stock market and actually invest it, but without investing real money. You can do that with this script! You use ESX money in-game to invest into the stock market. The stock market updates/refreshes every time you open the phone, so this updates in real live time. Make sure you sell your stocks when you are making money, not when you are losing money!
You must use https://money.cnn.com website for this to work properly (for each Stock). Add as many stocks as you would like
'BadgerStockMarket.Stocks.Normal' is the permission node (ACE permission node) that a player has to have to have that many stocks. You can set up multiple different permission nodes and allow a certain number of stocks for different groups of people. Maybe donators get more stocks?
Liability Reasons
For liability reasons, I wanted to include this at the bottom. BadgerStockMarket is in no way affiliated with the Stock Market and/or its proprieters. BadgerStockMarket was created as an educational tool to be used within the GTA V modification known as FiveM. BadgerStockMarket is also not affiliated with the Robinhood application. Although the script used the Robinhood logo. Once again, BadgerStockMarket was created as an educational tool. If anyone has a problem with this, please contact me and we can get the changes adjusted appropriately, thank you.
I think something broke with this part after âSendNUIMessageâ, if i understand, this part of the code will show some kind of notification when you open the phone no ? So, as i canât see any notifications, it can explain while the further part of the code wonât work properly like closing the phone, etcâŚ
Itâs the same for some scripts wich trigger pnotify / mythic_notify, when the line is broken (arg not found for example) the script canât complete his task and you can stay âfreezeâ (after an animation for ex.)
RegisterCommand(âstocksâ, function(source, args, rawCommand)
â Toggle on and off stocks phone
TriggerServerEvent(âBadgerStockMarket:Server:GetStockHTMLâ);
SetNuiFocus(true, true);
TriggerServerEvent(âBadgerStockMarket:Server:GetMaxStocksâ);
SendNUIMessage({
maxStocksAllowed = maxStocksOwned;
});
SendNUIMessage({
show = true;
});
TriggerServerEvent(âBadgerStocks:SetupDataâ);
while stockData == nil do
Wait(500);
SendNUIMessage({
stockData = stockData;
});
end
if stockData ~= nil then
SendNUIMessage({
stockData = stockData;
});
end
end)
Amazing release Badger!
Your scripts are always top notch and unique!
Nice touch on using the Robinhood logo within the script as well. I love using Robinhood IRL for the stock market, so will be really cool to see the stock market within FiveM.
Hey could you make a popup box so i could like chose the amount i want to but instead of buying 1 over and over again. its hard to buy like 200 of a stock lmao.
Ye I was going to do this, but got lazy. It probably wouldnât be too hard to add at a later date. Working on some other projects now to make some money since nothing in this community makes me money lol.