Esx_drugs - Refactored from esx_illegal_drugs

esx_drugs

v0.0.3

With this script you can add new drugs, with this script you can farm/process/sell(with npc)/use the drug with effect by just adding it to the config file.
You can use this script not only for drugs, but for other type of items to farm/process/sell.

Github: https://github.com/diorgesl/esx_drugs

Credit:

This script is based on esx_illegal_drugs

Features

  • Farm
  • Process into new item
  • Sell to an NPC
  • Use the item if you like with effects
  • Weight System from es_extended

Installation

  • Place the esx_drugs folder and into your resources folder.
  • ensure esx_drugs in a cfg file that is being executed by your server.

Thanks!

11 Likes

What does your add to the script?

1 Like

Read the config you will get the gist :+1:

Where Is SQL?

Added the SQL File…


SQL ERROR

1 Like

@8Pepa
As you see the error is because your table items dont have column “limit”.

I uploaded a new sql file to fix this problem, download again.

Thank

SCRIPT ERROR: @esx_drugs/server/server.lua:34: attempt to compare nil with number

Oh, sorry about this, this is because of column “limit” in database, the es_extended have to be to changed to get this working…
Search for in es_extended/server/common.lua around 22~31 line:

MySQL.Async.fetchAll('SELECT * FROM items', {}, function(result)
		for k,v in ipairs(result) do
			ESX.Items[v.name] = {
				label = v.label,
				weight = v.weight,
				rare = v.rare,
				canRemove = v.can_remove
			}
		end
	end)

and replace with:

MySQL.Async.fetchAll('SELECT * FROM items', {}, function(result)
		for k,v in ipairs(result) do
			ESX.Items[v.name] = {
				label = v.label,
				weight = v.weight,
				rare = v.rare,
				limit = v.limit,
				canRemove = v.can_remove
			}
		end
	end)

Now open es_extended/server/main.lua and add a new item to table.insert at line 63 and 80:

							limit = item.limit,

Now the script should work good.

1 Like

Nice scipt, but cant find sell point.

Did you enabled the Dealer in the config?

@diorgera i look all the script and i cant find how to enabled it, if you can help me. thx in advance

@stankolev
Search in config.lua for “–Dealer”, just remove the – and set the coords you want the NPC to spawn.

thx you very much, amazing job

Hi,

The police and ambulance restriction does not work.
we can harvest, transform and sell while being in this job

Can you see that please
thank you

@TonyMunicipale
Just fixed and added a button to the player stop the harversting, download again or just see the commit in github.

Hi amazing script. Love it. Can you please try to add like when the NPC call the Police it have like a %.
Thank in advance. Keep going looks great.

@sLam
Ofcourse bro, just added.

hey, i downloaded your update but in police or ambulance i can tjs harvest, transform or sell.

Do it if you could do like the original if you are a cop, for example the dot does not activate

Sorry for my bad English I’m French