How to add dirty money in account!

Hi, I have a robbery script which adds cash money to thief’s wallet but I wan’t to change it to make it give it to them in dirty money but I can’t find anything on the ESX documentation that explains how to add money to their dirty money, only thing’s I can find is for their normal accounts. Any ideas?

I tryed this:
xPlayer.addAccountMoney('black_money', amount)

And this is the original robbery script(Robbery Completed Event only):
TriggerClientEvent('esx_holdupbank:robberycomplete', savedSource, job)
						if(xPlayer)then

							xPlayer.addMoney(bank.reward)
							local xPlayers = ESX.GetPlayers()
							for i=1, #xPlayers, 1 do
								local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
								if xPlayer.job.name == 'police' then
										TriggerClientEvent('esx:showNotification', xPlayers[i], _U('robbery_complete_at') .. bank.nameofbank)
										TriggerClientEvent('esx_holdupbank:killblip', xPlayers[i])
								end
							end
						end
2 Likes

I thin addAccountMoney(type, amount) should be fine to work if you replace xPlayer.addMoney()
Do you have any error at all?

1 Like
TriggerClientEvent('esx_holdupbank:robberycomplete', savedSource, job)
						if(xPlayer)then

							xPlayer.addAccountMoney(bank.reward)
							local xPlayers = ESX.GetPlayers()
							for i=1, #xPlayers, 1 do
								local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
								if xPlayer.job.name == 'police' then
										TriggerClientEvent('esx:showNotification', xPlayers[i], _U('robbery_complete_at') .. bank.nameofbank)
										TriggerClientEvent('esx_holdupbank:killblip', xPlayers[i])
								end
							end
						end

try this :slight_smile:

1 Like

Thx for your replies !

1 Like

make sure to mark the solution if is worked for you :slight_smile:

To add to dirty money put replace it with addAccountMoney(type, amount)

Example: addAccountMoney(‘black_money’, 1000)

2 Likes