I think this should be it (don’t quote me on that)
Get the item info
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local itemInfo = Player.Functions.GetItemByName('markedbills')
Then you can get
itemInfo.worth
Not tested but this should be it
RegisterNetEvent('flex-moneywash:server:reward', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local itemInfo = Player.Functions.GetItemByName(Config.BagItem)
local cashamount = Config.BagAmount * itemInfo.worth
if Player.Functions.RemoveItem(Config.BagItem, Config.BagAmount) and Player ~= nil then
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[Config.BagItem], "remove", Config.BagAmount)
Player.Functions.AddMoney('cash', cashamount)
TriggerClientEvent('QBCore:Notify', src, Lang:t('success.getmoney')..cashamount, 'success')
end
end)
Do you know any reason the location won’t show up? Everything is set correctly and there are no errors, but nothing is showing up @ the vec locations for the washers or tp.
Use multiple machines (changing the “already using a machine”) so I don’t have to wait each time. I could use all machines if needed. I looked into the client/server side, but I must of missed it.