BACKUP
your resources
folder cause when something is wrong you have a backup.cash
, black_money
, crypto
is not dependent on the item amount, but the item amount is dependent on the currency amount.ensure mh-cashasitem
, make sure this is above ensure [qb]
ensure qb-core
ensure mh-cashasitem -- add here
ensure [qb]
ensure [standalone]
ensure [voice]
ensure [defaultmaps]
ensure [mh]
/cash
to see the amount/bank
to see the amount/blackmoney
to see the amount/crypto
to see the amount
QBConfig.Money.MoneyTypes = { cash = 500, bank = 5000, crypto = 0, black_money = 0 } -- type = startamount - Add or remove money types for your server (for ex. blackmoney = 0), remember once added it will not be removed from the database!
QBConfig.Money.DontAllowMinus = { 'cash', 'crypto', 'black_money' } -- Money that is not allowed going in minus
-- Add Item Example
Player.Functions.AddItem(ItemData.name, amount, toSlot, ItemData.info)
exports['mh-cashasitem']:UpdateCash(source, ItemData, amount, "add")
-- Remove Item Example Player.Functions.RemoveItem(ItemData.name, amount, toSlot) exports['mh-cashasitem']:UpdateCash(source, ItemData, amount, "remove")
# Add in `[qb]/qb-core/shared/items.lua`
- and don't forgot the add the `cash.png` and `blackmoney.png` and `crypto.png` in to your inventory image folder.
```lua
cash = { name = 'cash', label = 'Cash', weight = 0, type = 'item', image = 'cash.png', unique = false, useable = false, shouldClose = true, combinable = nil, description = 'Cash' },
black_money = { name = 'black_money', label = 'Black Money', weight = 0, type = 'item', image = 'black_money.png', unique = false, useable = false, shouldClose = true, combinable = nil, description = 'Black Money?' },
crypto = { name = 'crypto', label = 'Crypto', weight = 0, type = 'item', image = 'crypto.png', unique = false, useable = false, shouldClose = true, combinable = nil, description = 'Crypto' },
The black_money uses the item amount as a number,
and the marketbills uses the item amount as a table.
so you need to edit that part of the code.
from this
local worth = {value=10} -- table
Player.Functions.AddItem('marketbills', worth) -- to add marketbills
Player.Functions.RemoveItem('marketbills', worth)-- to remove marketbills
to this
local amount = 10 -- number
Player.Functions.AddMoney('black_money', amount) -- to add blackmoney
Player.Functions.RemoveMoney('black_money', amount) -- to remove blackmoney