[ESX] Tobacco machine [FREE]

ESX_TABACO

Hello today I bring you a new script, in which you can buy a wide variety of fully interactive tobacco packages, the script contains the textures of the tobacco machines, I put them to save you all the time of looking for it, I hope you like it and do not forget to like the post

PD : You can add stress or thirst when the item is used…

TriggerClientEvent('esx_status:add', source, 'thirst', 200000)
--------------------------------------------------------------
ESX.RegisterUsableItem('fortuna_ciggar', function(source)
    local xPlayer = ESX.GetPlayerFromId(source)
    xPlayer.removeInventoryItem('fortuna_ciggar', 1)
    TriggerClientEvent('estanco:animacion', source)
    TriggerClientEvent('esx_status:add', source, 'thirst', 200000)

end)

Dependencies : ESX & DPEMOTES

GitHub
Preview

9 Likes

Nice and simple, good job!

How did you change the salary notification you got (top right)? Looking to move away from the advanced esx notification…

Look forward to hearing from you! Whippet :100:

1 Like

Thank you so much!!!
you can try to put this, the notification will appear at the top

TriggerClientEvent('esx:showHelpNotification', source, 'Has comprado un paquete de ~b~Marlboro ~w~ por ~g~5$!')

Nah, I mean that you got a notification at 48 seconds for your salary.

How did you replace the standard notification with the one at 48 seconds?

1 Like

ok, I use the mythic notification, and change the salary period in the es_extended. You can change it easily, if you need help ask me

1 Like

quick question : can you walk and smoke at the same time, ? is there a way to cancel the animation… oops that was two questions hehe. thanks for the hard work. I think I need this in my life

1 Like

Hello, thank you very much, you cannot smoke while you walk, basically because it is executing an animation from the normal animations menu, but if you can cancel while you smoke, if you raise your hands you can cancel the animation, or you can wait until it finishes, I will upload a new one more worked version in which you can cancel the animation at any time without raising your hands.

thanks

1 Like

:wink: your welcome

de locos

1 Like

nice!

1 Like

That’s handy, we use mythic also for notifications.

You don’t happen to have a snippet of code where and how you replaced the salary mythic notification do you?

That’d be so helpful! Thanks :100:

1 Like

thanks!!

yes. i have it!!
Go in es_extended/server/paycheck.lua (comment the code fragment that you already have and paste this)

ESX.StartPayCheck = function()
	function payCheck()
		local xPlayers = ESX.GetPlayers()
		for i=1, #xPlayers, 1 do
			local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
			local job     = xPlayer.job.grade_name
			local salary  = xPlayer.job.grade_salary
			if salary > 0 then
				if job == 'unemployed' then -- unemployed
					xPlayer.addAccountMoney('bank', salary)
					TriggerClientEvent('mythic_notify:client:SendAlert', xPlayer.source, { type = 'sueldo', text = _U('received_help', salary) })
				elseif Config.EnableSocietyPayouts then -- possibly a society
					TriggerEvent('esx_society:getSociety', xPlayer.job.name, function (society)
						if society ~= nil then -- verified society
							TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function (account)
								if account.money >= salary then -- does the society money to pay its employees?
									xPlayer.addAccountMoney('bank', salary)
									account.removeMoney(salary)
	
									TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_salary', salary), 'CHAR_BANK_MAZE', 9)
								else
									TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), '', _U('company_nomoney'), 'CHAR_BANK_MAZE', 1)
								end
							end)
						else -- not a society
							xPlayer.addAccountMoney('bank', salary)
							TriggerClientEvent('mythic_notify:client:SendAlert', xPlayer.source, { type = 'sueldo', text = _U('received_help', salary) })
						end
					end)
				else -- generic job
					xPlayer.addAccountMoney('bank', salary)
					TriggerClientEvent('mythic_notify:client:SendAlert', xPlayer.source, { type = 'sueldo', text = _U('received_help', salary) })
				end
			end

		end
		SetTimeout(Config.PaycheckInterval, payCheck)

	end
	SetTimeout(Config.PaycheckInterval, payCheck)
end
1 Like

do you know why ExecuteCommand(‘e smoke’) somehow do not work for me and smoking animation won’t start. Should I try TaskStartScenarioInPlace(playerPed, “WORLD_HUMAN_SMOKING”, 0, true) for that or I should add that command somewhere?

Maybe it’s because you don’t have the dpemotes, it usually happens since that command works when you have the dpemotes. You can try putting TaskStartScenarioInPlace (playerPed, “WORLD_HUMAN_SMOKING”, 0, true) in the place where it says ExecuteCommand (‘e smoke’)

1 Like

ah yes, that makes sense. :)) I overlooked that there is a dependency and wasn’t sure where I can find this command. thanks.
– that would be the part to replace ExecuteCommand (‘e smoke’) line
Citizen.CreateThread(function()
TaskStartScenarioInPlace(ped, “WORLD_HUMAN_SMOKING”, 0, true)
end)

1 Like

Yes!!

There is only on location at the strip club? Is it possible to add other locations?

Yes , u can change the locations