[How-To] Add dirty money into "old" ES mode

no solution leak…

how to use

AddEventHandler("item:sell", function(id, qty, price)
    local player = getPlayerID(source)
    MySQL:executeQuery("UPDATE user_inventory SET `quantity` = @qty WHERE `user_id` = '@username' AND `item_id` = @id", { ['@username'] = player, ['@qty'] = tonumber(qty), ['@id'] = tonumber(id) })
	TriggerEvent("es:getPlayerFromId", source, function(user)
		
		user:addDirty_Money(tonumber(price)) --When selling illegal items, add the money to dirty money
	
	end)
end)

? :slight_smile:

hi, do you have an idea?

How do you do to instal it can you help me I can not get it

Hello all and thanks for this awesome share !Someone has any idea how can we do a place to transfer the dirtymoney into “normal” money ? Thanks !

1 Like

I have this error can you help me pls ???

@nkv go to __resource.lua and check if contains

files {
‘PATH TO IMG’
}

BUG:
If you have 0 money, money and dirty-money do not appear

Correction: in ui.html add arg “1” to property css opacity

if(item.setDisplay == true){
	$("#money").css('opacity', 1, item.display)
	$("#dirty_money").css('opacity', 1, item.display)
}

Someone knows how to put dirty money only for the illegal please? Cause when I do a legal job like mineur thats give me dirty money
Thanks for your answers

Well, i would say you could check the ID of the item and add dirty money only for specific items, or set a value in the item table to identify if the item is illegal or not.

If your normal jobs give dirty money, you should check which addMoney function is called when a job is finished.

i want to know if there is a version whit MYSQL that I can find.

[How-To] Add dirty money into "old" ES mode

“old” ES mode means that it’s for MySQL

Yes, but the demo server I released was with couchDB. Sunday I will release a MySQL version working with Async.

Ok, so nervermind ^^’
Just be more obvious in the title :slight_smile:

The tutorial is for mysql.
I have updated that the files I added are only for couchDB. I made that because people had trouble to install this with couchDB.

My dirty money icon follows my money icon :smile:
any idea what i’ve done wrong?

Dear all,

From now on, I stop all development with FiveM. I will not give any support on this tutorial. I have given you the files with the code.
Yes it was made with CouchDB, but all the rest can be used on any database you can imagine.

Keep doing amazing stuff.

Regards,
Hoegarden31

– Pause menu disable money display
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
if IsPauseMenuActive() and not pauseMenu then
pauseMenu = true
TriggerEvent(‘es:setMoneyDisplay’, 0.0)
TriggerEvent(‘jobcenter:setJobDisplay’,0.0)
elseif not IsPauseMenuActive() and pauseMenu then
pauseMenu = false
TriggerEvent(‘es:setMoneyDisplay’, 1.0)
TriggerEvent(‘jobcenter:setJobDisplay’,1.0)
end
end
end)

Can anyone clarify how to make the HUD dissapear on map? Adding this piece of code to my es_freeroam client script doesn’t do a thing. Would love if someone could point me in the right direction

hi there i have the same issue dirtymoney shows as undefined . how did u fix it . please help