[Release] [ESX] [Drugs]

Just in case anyone is having an issue where people can open menus and have to re log I’ve got a bit of code you add to client.lua and it will stop them opening the menus and phone.

-- Disable Controls
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(10)
		if isInZone then
			DisableControlAction(2, 24, true) -- Attack
			DisableControlAction(2, 257, true) -- Attack 2
			DisableControlAction(2, 25, true) -- Aim
			DisableControlAction(2, 263, true) -- Melee Attack 1
			DisableControlAction(2, Keys['R'], true) -- Reload
			DisableControlAction(2, Keys['bottom-right'], true) -- Open phone (not needed?)
			DisableControlAction(2, Keys['SPACE'], true) -- Jump
			DisableControlAction(2, Keys['Q'], true) -- Cover
			DisableControlAction(2, Keys['TAB'], true) -- Select Weapon
			DisableControlAction(2, Keys['F'], true) -- Also 'enter'?
			DisableControlAction(2, Keys['F1'], true) -- Disable phone
			DisableControlAction(2, Keys['F2'], true) -- Inventory
			DisableControlAction(2, Keys['F3'], true) -- Animations
		else
			Citizen.Wait(1000)
		end
	end
end)

hello how to make the harvest point change itself?

how would i wash this moeny

Is it possible to change the name of the drugs?

Thanks!

Is it possible to set drugs blips as drugs zones?
just for do it harder to players, they will need to find this points and we wont give them directly

Alright so I’ve tried this multiple times and for some reason not getting any luck if anyone can assit on how to check if a player is in a vehicle and then do something that would be great this is what I got so far.


esx_drugs_sv.lua


	if CopsConnected < Config.RequiredCopsCoke then
		TriggerClientEvent('esx:showNotification', source, _U('act_imp_police', CopsConnected, Config.RequiredCopsCoke))
		return
	end

	SetTimeout(Config.TimeToProcess, function()

		if PlayersTransformingCoke[source] == true then

			local _source = source
			local xPlayer = ESX.GetPlayerFromId(_source)
			local ped = GetPlayerPed(-1)

			local cokeQuantity = xPlayer.getInventoryItem('coke').count
			local poochQuantity = xPlayer.getInventoryItem('coke_pooch').count

			if poochQuantity > 35 then
				TriggerClientEvent('esx:showNotification', source, _U('too_many_pouches'))
			elseif cokeQuantity < 5 then
				TriggerClientEvent('esx:showNotification', source, _U('not_enough_coke'))
			elseif IsPedInAnyVehicle(ped) then 
				TriggerClientEvent('esx:showNotification', source, 'Step outside the vehicle')
			else
				xPlayer.removeInventoryItem('coke', 5)
				xPlayer.addInventoryItem('coke_pooch', 1)
			
				TransformCoke(source)
			end

		end
	end)
end

What I am trying to do is do a check if the player is in a vehicle it will tell them to step outside the vehicle.

elseif IsPedInAnyVehicle(ped) then 
				TriggerClientEvent('esx:showNotification', source, 'Step outside the vehicle')
			else

But for some reason it will not run its giving issues

Error resuming coroutine: server/esx_drugs_sv.lua:114: attempt to call a nil value (global ‘IsPedInAnyVehicle’)
stack traceback:
server/esx_drugs_sv.lua:114: in function <server/esx_drugs_sv.lua:99>

When editing the amount of cops there has to be online for you to be able to collect the drugs the amount of cops doesn’t change and just stays at 2 any help?

So guys, if i want another job not to pickup the drugs… like the cops. where can i find it ? :confused: i have been looking all the scripts thouh, and i cant find anything with cops not allowed too pick it up fx…

i got everything working fine, But i cant process my coke? i can grab it but i cant posses it?

same please let me know if u fix it

fixed it installing a older version of the mod, Have no idea what the problem could be

can you send me those locations ? jiggyhello
#2163

is there any way I can make the money they earn from selling drugs go to their bank or cash instead of going into the dirty money coloumn? we dont have black market nor do we intend on putting one in.

yes this is very simple, go to esx_drugs/server/main.lua

find the config
xPlayer.addAccountMoney(‘black_money’, 198)
change it to
xPlayer.addMoney(480)

change the numbers to the amount you want payout/ repeat for all the lines

thanks for the reply Bobby, so like this? I highlighted what I did.

yep but make sure you replace all 5-6 i have 6 on mine

Yes of course bro, okay last question I got on this script, do I change the inventory limit from main/server or do I go in the actual database for that?

ive been able to use the database with no problems, however ive heard sometimes that wont work so if dosent just make sure you go and change it within the files to force it to listen :stuck_out_tongue:

Still having issues with inventory limitsAlright guys so I did this from esx_drugs_sv.lua and then straight from my Database, I assigned them both to 30 but it still says coke inventory full, there is 0 coke or anything in my inventory, what am I doing wrong?

full1

Can someone send me a map of the markers for the drug and proccesing places?