[Release] [ESX] NPC Drug Sales (Optimized)

Hi i release a version optimized for selling drugs to NPC.

Dependencies:
es_extended
esx_addons_gcphone
esx_drugs (sql items required)

Credits:
esx_drugs
esx_drugsellnpc
esx_npcdrugsales

New Release: (with alert to police when npc refuses)
esx_drugselling (updated).rar (4.0 KB)

Old Release:
esx_drugselling.rar (3.8 KB)

Description:
Script more optimized, consumes 5 times less than the others scripts npc drug sales.
(not fps drop)

23 Likes

Is notified to police when an NPC refuses to buy the drug??

1 Like

Not alerts. you can add it if you want the alerts.

Do you think about putting this functionality?

is esx drugs needed?

esx_drugs required yes

No ESX Drugs is not required, only the default items and I supposed a way to acquire them in-game. (Weed, Weed_Pooch, Meth, Meth_Pooch, Coke, Coke_Pooch and Opium, Opium_Pooch.)

1 Like

How is this one better then the other well to npc scripts?

It’s (optimized), or that’s what OP says.

I could optimize the other script too. What makes it unique?

What makes it unique?

Old Script: 0.70ms if pooches on players, 0.50ms without pooches.

Mine: 0.15ms if pooches on players, 0.02ms without pooches.

You can look my code and learn. my server can host 128 players with +80fps constant, all scripts released are not optimized.

1 Like

Alright. I’l check it out.

1 Like

stasiek selldrugs, just consume 0.10ms constant. and thats script can alert to police when npc refuses to buy drugs.
anyway, nice release

SCRIPT ERROR: @esx_drugselling/server/main.lua:99: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:108: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:99: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:108: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:99: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:108: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:99: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:108: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:99: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:108: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:99: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:108: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:99: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:108: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:99: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_drugselling/server/main.lua:108: attempt to index a nil value (local ‘xPlayer’)

Should make it so we can change the names of the items in the config, for those of us that use esx_jk_drugs

Yea im currently looking for a script to sell as well for esx_jk_drugs

what is the benefits when you sell drugs to npc? or what items you receive to npc?

pretty easy to do

just change these to your item name would be in the database items table.

local methQTE = xPlayer.getInventoryItem('meth_pooch').count
TYPE = "meth_pooch" 

Hi plz help. when my character goes in thew circle to harvest nothing happens. i have cancelled the animation because ive read somewhere that might help but nothing adds to inventory when harvesting

Updated

[Add] Cops alert when NPC refuses to buy drugs.

1 Like