Skip to main content

getStocks

exports["RiP-Invest"]:getStocks(filter, cb) 

This function returns all stocks (with filter)

Arguments

NameTypeOptionalExplenation
filterInteger/StringYesStock filter (playerId/stockSymbol)
cbFunctionYesCallback function

Returned Table

NameTypeExplenation
idIntegerStock id
typeStringStock type (crypto/stock)
nameStringStock name
symbolStringStock symbol
amountIntegerStock amount (when player stocks)
priceIntegerStock price

Example

local xPlayer = ESX.GetPlayerFromId(source)

exports['RiP-Invest]:getStocks(xPlayer.source, function(xStocks)
for r,p in pairs(xStocks) do
print(p.id)
end
end)