Coder Social home page Coder Social logo

ps-drugprocessing's People

Contributors

alivemonstor avatar andyauk avatar ansljeremy avatar darktrovx avatar flexbuf avatar flobbah avatar gitmocha avatar googleoblivion avatar i-kulgu avatar ihyajb avatar in1ghtm4r3 avatar itzmuri avatar kevingirardx avatar lenzh avatar merpindia avatar molicheu avatar monkeywhisper avatar myshkovsky avatar tangogow avatar tehsteel avatar ushifty avatar xfutte avatar xthrasherrr avatar yanpla avatar zwyzzzzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ps-drugprocessing's Issues

Collect HeroinField

Hello, we have the problem that we cannot always or collect every plant in the HeroinField? then you have to look at other plants that don't work either D:

Some targets missing

Weed Processing- No target

HydrochloricAcid Farm- no target

Pickup Coke leafs- nothing happens

Heroin Processing - no target

coca powder processing item checks

There may be an issue with coke processing with the processing coca powder part, in client/coke.lua

QBCore.Functions.TriggerCallback('ps-drugprocessing:validate_items', function(result)
                if result then
                    CutCokePowder()
                else
                    QBCore.Functions.Notify(Lang:t("error.not_all_items"), 'error')
                end
            end, check)

If you don't have the right items, no matter if its the 1 finescale, 5 baking soda or 10 cocaine it just throws the same error "You do not have the right items needed". You need the correct amount(or more) of all items for the check to pass then it works fine. Other steps it tells you specifically what item you are missing.

There is a check serverside (server/coke.lua) for baking soda & cocaine, but it does not get triggered because the client side forces you to have the right amount. There is no actual check and error for missing the finescale at all.

        if Player.Functions.RemoveItem('bakingsoda', Config.CokeProcessing.BakingSoda) then
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.no_bakingsoda_amount"), "error")
        end
    else
        TriggerClientEvent('QBCore:Notify', src, Lang:t("error.no_cokain_amount"), "error")```

Lab Fixes

If I have the cocainekey third eyeing Draco to enter the lab doesn't work.

fixed only one barrel spawn in sulfuric acid field

local QBCore = exports['qb-core']:GetCoreObject()
local spawnedSulfuricAcidBarrels = 0
local SulfuricAcidBarrels = {}

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(10)
		local coords = GetEntityCoords(PlayerPedId())

		if GetDistanceBetweenCoords(coords, Config.CircleZones.SulfuricAcidFarm.coords, true) < 50 then
			SpawnSulfuricAcidBarrels()
			Citizen.Wait(500)
		else
			Citizen.Wait(500)
		end
	end
end)

RegisterNetEvent("ps-drugprocessing:pickSulfuric")
AddEventHandler("ps-drugprocessing:pickSulfuric", function()
		Citizen.Wait(0)
		local playerPed = PlayerPedId()
		local coords = GetEntityCoords(playerPed)
		local nearbyObject, nearbyID

		for i=1, #SulfuricAcidBarrels, 1 do
			if GetDistanceBetweenCoords(coords, GetEntityCoords(SulfuricAcidBarrels[i]), false) < 2 then
				nearbyObject, nearbyID = SulfuricAcidBarrels[i], i
			end
		end

		if nearbyObject and IsPedOnFoot(playerPed) then

			if not isPickingUp then
				isPickingUp = true
				TaskStartScenarioInPlace(playerPed, 'world_human_gardener_plant', 0, false)

				QBCore.Functions.Progressbar("search_register", Lang:t("progressbar.collecting"), 10000, false, true, {
					disableMovement = true,
					disableCarMovement = true,
					disableMouse = false,
					disableCombat = true,
				}, {}, {}, {}, function() -- Done
					ClearPedTasks(PlayerPedId())
					SetEntityAsMissionEntity(nearbyObject, false, true)
					DeleteObject(nearbyObject)

					table.remove(SulfuricAcidBarrels, nearbyID)
					spawnedSulfuricAcidBarrels = spawnedSulfuricAcidBarrels - 1
	
					TriggerServerEvent('ps-drugprocessing:pickedUpSulfuricAcid')

				end, function()
					ClearPedTasks(PlayerPedId())
				end)

				isPickingUp = false
			end
		else
			Citizen.Wait(500)
		end
end)

AddEventHandler('onResourceStop', function(resource)
	if resource == GetCurrentResourceName() then
		for k, v in pairs(SulfuricAcidBarrels) do
			SetEntityAsMissionEntity(v, false, true)
			DeleteObject(v)
		end
	end
end)

function SpawnSulfuricAcidBarrels()
	while spawnedSulfuricAcidBarrels < 15 do
		Citizen.Wait(0)
		local sulfuricCoords = GenerateSulfuricAcidCoords()
		RequestModel(`mw_sulfuric_barrel`)
		while not HasModelLoaded(`mw_sulfuric_barrel`) do
			Wait(100)
		end
		local obj = CreateObject(`mw_sulfuric_barrel`, sulfuricCoords.x, sulfuricCoords.y, sulfuricCoords.z, true, true, false)
		PlaceObjectOnGroundProperly(obj)
		FreezeEntityPosition(obj, true)
		table.insert(SulfuricAcidBarrels, obj)
		spawnedSulfuricAcidBarrels = spawnedSulfuricAcidBarrels + 1
	end
end

function ValidateSulfuricAcidCoord(plantCoord)
	if spawnedSulfuricAcidBarrels > 0 then
		local validate = true

		for k, v in pairs(SulfuricAcidBarrels) do
			if GetDistanceBetweenCoords(plantCoord, GetEntityCoords(v), true) < 5 then
				validate = false
			end
		end

		if GetDistanceBetweenCoords(plantCoord, Config.CircleZones.SulfuricAcidFarm.coords, false) > 50 then
			validate = false
		end

		return validate
	else
		return true
	end
end

function GenerateSulfuricAcidCoords()
	while true do
		Citizen.Wait(1)

		local sulfuricCoordX, sulfuricCoordY

		math.randomseed(GetGameTimer())
		local modX = math.random(-7, 7)

		Citizen.Wait(100)

		math.randomseed(GetGameTimer())
		local modY = math.random(-7, 7)

		sulfuricCoordX = Config.CircleZones.SulfuricAcidFarm.coords.x + modX
		sulfuricCoordY = Config.CircleZones.SulfuricAcidFarm.coords.y + modY

		local coordZ = GetCoordZSulfuricAcid(sulfuricCoordX, sulfuricCoordY)
		local coord = vector3(sulfuricCoordX, sulfuricCoordY, coordZ)

		if ValidateSulfuricAcidCoord(coord) then
			return coord
		end
	end
end

function GetCoordZSulfuricAcid(x, y)
	local groundCheckHeights = { 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 150.0 }

	for i, height in ipairs(groundCheckHeights) do
		local foundGround, z = GetGroundZFor_3dCoord(x, y, height)

		if foundGround then
			return z
		end
	end

	return 18.31
end

Add items to the required items CokeLab "Fixed"

RegisterNetEvent('ps-drugprocessing:ProcessCocaFarm')
AddEventHandler('ps-drugprocessing:ProcessCocaFarm', function()
local coords = GetEntityCoords(PlayerPedId(source))

if GetDistanceBetweenCoords(coords, Config.CircleZones.CokeProcessing.coords, true) < 5 then
	if not isProcessing then
		QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
			if result then
				print('You have this item SA')
				hasitem1 = true
			else
				QBCore.Functions.Notify('You need Coca Leafs!...', 'error')
			end
		end, 'coca_leaf')
		Citizen.Wait(1000) -- BUFFER
		QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
			if result and hasitem1 then
				print('You have this item HA')
				ProcessCoke()
			else
				QBCore.Functions.Notify('You need Scissors to cut with!..', 'error')
			end
		end, 'trimming_scissors')
	end
end

end)

Processing coke bricks

packaging small coke bricks into large coke bricks doesnt work, dont know why but it says you dont have coke package when you do have them.

No Meth given when packing.

When "packing" the meth, the process bar shows up, but when it is done no item is given, and the meth tray is not removed.
Latest update #47

MethLab

After processing the items into Chem Mix - works fine
Then going to cool them to Chem Vapor - Works fine

But

When going to heat the Chem Vapor to Tray just gives another Vapor again doesnt work

Say it removes Chem mix to Vapor, doesnt issue a tray sadly

Exploit!

While processing any drug, If someone cuff/rob and takes the item required to process,
after the process is finished you still get the item.

Its like there is no item check after progress is finished

weed lab issue

hi how do i get weed lab to get working i dont understand to weed and coke lab have the same coords

[SUGGESTION] Effects

Is it possible to include the effects directly in the script from your side?
Because when I use the item e.g. heroin is does nothing.

Cannot process small coke bricks

Client/Coke/ Line 106

end, 'coke_small_brick', Config.CokeProcessing.SmallCokeBrick)
This line needs to be changed to
end, 'coke_small_brick', Config.CokeProcessing.SmallBrick)

It's pulling the wrong config for hasitem check.

Heroin Process

Heroin Process dose not take away poppy resin when made into shot you can make unlimited shots with only 1 poppy

Few issues and possible features

So i have poly zones setup and working great but only for a few things.

Weed: 10 or so spawns per player
Coke Leaves: 10 or so spawns per player
Poppies: 10 or so spawns per player
Chemicals: 10 or so spawns per player
Sodium: 1 spawn per player
Hydro: 1 spawn per player
Sulfuric: 1 spawn per player

No idea why the Sodium, hydro and sulfuric only spawn one per player,

One thing id love too see if just too be able too set a spawn limit within the poly zone/circle zones, and remove the playerpedid stuff cause then servers run into the issue on if 5 people turn up too weed then that 10 plants turns into 50+ and you have too try and find the plants that belong too your ID instead of being able too just pick any plant, instead maybe could have a this plate is being picked if someone try's too pick the same plant?

Otherwise i love this script and would love too see it evolve into the must have drug script for any fivem server.

Coke Gather Issue

i have the option to pick the coke leaf just when i actually click on it nothing happens and must be an issue with the event
image

some things qb target isnt working with, get this error.

Snipaste_2022-04-25_10-54-04

getting this error when trying to interact with some items, such as draco. weed, etc.

some "target items" dont work, ie you can have the leafs on you but it will not process. the meth processing with all the acid takes my items, but gives nothing in return. i put all things in where they belong, maybe i'm missing something.

do i need to remove the original qb-drugs?

Drug Effects..

Is there any way to change or remove the effect of the drug? With NVE it's not even possible to see.

only 1 maybe 2 barrels

for all the acids there is only 1 maybe 2 barrels at most chems is perfect also i wont let m,e change the coords of coke processing

Meth Lab

I am having issues with my meth lab, such as me not being able to start any of the meth processes. I believe it is due to the fact that the meth location was change but at that point the meth function should still be able to work properly.

Bugs

-When adding the chemicals in the first part of the Meth Processing, the process is done, the progress bar is gone, stand there and nothing else happens, so you go to the next step and qb-notify says "processing has stopped because you abandoned the area". The was nothing more to do for that step?
-When processing the chemicals at Humane, tho you're selecting to make and are recieving LSA, the notify is showing "The Sulfuric Acid Process Was Successful".

  • thionyl_chloride processing doesn't seem to do anything. I gave myself thionyl_chloride and nothing happens at the processing spot.
    -No where to process poppy seeds/heroin.

Bypass Weed Process

Testing this out - seems I can goto Weed Process and process without the Plants

Fix for only one barrel spawn in sulfuric acid field

local QBCore = exports['qb-core']:GetCoreObject()
local spawnedSulfuricAcidBarrels = 0
local SulfuricAcidBarrels = {}

Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
local coords = GetEntityCoords(PlayerPedId())

	if GetDistanceBetweenCoords(coords, Config.CircleZones.SulfuricAcidFarm.coords, true) < 50 then
		SpawnSulfuricAcidBarrels()
		Citizen.Wait(500)
	else
		Citizen.Wait(500)
	end
end

end)

RegisterNetEvent("ps-drugprocessing:pickSulfuric")
AddEventHandler("ps-drugprocessing:pickSulfuric", function()
Citizen.Wait(0)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
local nearbyObject, nearbyID

	for i=1, #SulfuricAcidBarrels, 1 do
		if GetDistanceBetweenCoords(coords, GetEntityCoords(SulfuricAcidBarrels[i]), false) < 2 then
			nearbyObject, nearbyID = SulfuricAcidBarrels[i], i
		end
	end

	if nearbyObject and IsPedOnFoot(playerPed) then

		if not isPickingUp then
			isPickingUp = true
			TaskStartScenarioInPlace(playerPed, 'world_human_gardener_plant', 0, false)

			QBCore.Functions.Progressbar("search_register", Lang:t("progressbar.collecting"), 10000, false, true, {
				disableMovement = true,
				disableCarMovement = true,
				disableMouse = false,
				disableCombat = true,
			}, {}, {}, {}, function() -- Done
				ClearPedTasks(PlayerPedId())
				SetEntityAsMissionEntity(nearbyObject, false, true)
				DeleteObject(nearbyObject)

				table.remove(SulfuricAcidBarrels, nearbyID)
				spawnedSulfuricAcidBarrels = spawnedSulfuricAcidBarrels - 1

				TriggerServerEvent('ps-drugprocessing:pickedUpSulfuricAcid')

			end, function()
				ClearPedTasks(PlayerPedId())
			end)

			isPickingUp = false
		end
	else
		Citizen.Wait(500)
	end

end)

AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then
for k, v in pairs(SulfuricAcidBarrels) do
SetEntityAsMissionEntity(v, false, true)
DeleteObject(v)
end
end
end)

function SpawnSulfuricAcidBarrels()
while spawnedSulfuricAcidBarrels < 15 do
Citizen.Wait(0)
local sulfuricCoords = GenerateSulfuricAcidCoords()
RequestModel(mw_sulfuric_barrel)
while not HasModelLoaded(mw_sulfuric_barrel) do
Wait(100)
end
local obj = CreateObject(mw_sulfuric_barrel, sulfuricCoords.x, sulfuricCoords.y, sulfuricCoords.z, true, true, false)
PlaceObjectOnGroundProperly(obj)
FreezeEntityPosition(obj, true)
table.insert(SulfuricAcidBarrels, obj)
spawnedSulfuricAcidBarrels = spawnedSulfuricAcidBarrels + 1
end
end

function ValidateSulfuricAcidCoord(plantCoord)
if spawnedSulfuricAcidBarrels > 0 then
local validate = true

	for k, v in pairs(SulfuricAcidBarrels) do
		if GetDistanceBetweenCoords(plantCoord, GetEntityCoords(v), true) < 5 then
			validate = false
		end
	end

	if GetDistanceBetweenCoords(plantCoord, Config.CircleZones.SulfuricAcidFarm.coords, false) > 50 then
		validate = false
	end

	return validate
else
	return true
end

end

function GenerateSulfuricAcidCoords()
while true do
Citizen.Wait(1)

	local sulfuricCoordX, sulfuricCoordY

	math.randomseed(GetGameTimer())
	local modX = math.random(-7, 7)

	Citizen.Wait(100)

	math.randomseed(GetGameTimer())
	local modY = math.random(-7, 7)

	sulfuricCoordX = Config.CircleZones.SulfuricAcidFarm.coords.x + modX
	sulfuricCoordY = Config.CircleZones.SulfuricAcidFarm.coords.y + modY

	local coordZ = GetCoordZSulfuricAcid(sulfuricCoordX, sulfuricCoordY)
	local coord = vector3(sulfuricCoordX, sulfuricCoordY, coordZ)

	if ValidateSulfuricAcidCoord(coord) then
		return coord
	end
end

end

function GetCoordZSulfuricAcid(x, y)
local groundCheckHeights = { 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 150.0 }

for i, height in ipairs(groundCheckHeights) do
	local foundGround, z = GetGroundZFor_3dCoord(x, y, height)

	if foundGround then
		return z
	end
end

return 18.31

end

Unable to target drug picking

Unable to target / pick most of the drugs

I've tried with heroin and also with coca leaves and both do the same thing? Any idea what could be causing this?

Bypassing meth steps

You can actually bypass gathering the materials, and mixing by just going to the decrease heat target. It will give you a meth tray.

Can't collect coke leaves

Trying to pick coke leaves, I am not getting the option on target.
I have tried replacing the model with the poppy plant, which works.
So my thought is that it is the model that somehow is bugging.
It is a fresh install
image

Edit: All other drugs are working
Edit: Just posted this issue at qb-target as I was having the same error with another script [qb-target ticket]

coke field

SCRIPT ERROR: @ps-drugprocessing/client/coke.lua:141: attempt to call a nil value (field 'LoadModel')
and that line is
QBCore.Functions.LoadModel(mw_coke_plant)
on coke field is empty

Weed

Weed doesnt seem to work, my players cant pick it up, tested myself. Text me if more info is needed

Target Walter and Draco

What do you need to interact with both targets? I attempted many things but can't seem to figure it out.

Coke Processing Config math.random is not actually randomizing

I've noticed over the past few days for everyone that has been doing it, that the coke processing has been pushing the same exact amount each time until either server or script restarts. Looking into it, from what I can gather is that the config isn't refreshing the random number each time the event is triggered. It sets one number each restart and sends it each time to the event.

I don't really know how to do a pull request here to be honest, but I was able to resolve this and get varying numbers each event trigger by moving the math.random to the server event on the coke processing and the small bricks. Attached image is how I fixed it. Lines 18 and 36 added and changed the Config.CokeProcessing.ProcessCokeLeaf(lines 21 and 23) and Config.CokeProcessing.SmallCokeBrick(lines 40 and 43) to the local total.

image

if this isnt right, let me know, but it is working fine for me.

I also assume that the math.random for meth processing is also causing issues, but I have not looked into that as of this moment.

Coke Lab Refine Not Working

I have had 10 Coke Powder and 5 Baking Soda. But still when I try to refine it does not give feedback or output. Using third eye action to refine does nothing. No errors on console.

Remove the E thing

Hi there, firstly i wanna say this is the best drug script ever. Is there anyway to remove the E thing on harvesting weed. Thanks in advance

hello

this script have npc selling and how to enable blip on map

Request: ability to have client side customization

Having the ability to enable each client to select the hud position and the generic sizing that they want would be amazing. if we really want to make it even sweeter would allow admins to toggle each field to enable for client modification, populating the same component with the client side fields that admins would see, but slimmed down.

perhaps saving those few fields in the player table, or even its own, based off a license id would mean that different CID's wouldn't have to set up the positioning for each character. also, it'd be a smaller table. If they don't have it modified, default to the server's default settings.

Respawn issue/radius issue

There seems to be an issue with respawning. None of the items to be picked respawn unless you leave the area and come back. Sodium Hydroxide & heroin field are the exceptions(See below). Also, it seems like none of these are following the radius I set. No matter what I set(I set it to 20 for e.x), they seem to keep spawning at an 100 radius.

Note: I've only changed the animations for picking chemicals, and the progressbar for it.. that is it.

Weedfield - Does not respawn unless you leave the area and come back
HydrochloricAcidFar - Does not respawn unless you leave the area and come back
SulfuricAcidFarm - Does not respawn unless you leave the area and come back
SodiumHydroxideFarm -Respawns almost instantly, always in the same spots.
chemicalsfield - Does not respawn unless you leave the area and come back
cokefield - Does not respawn unless you leave the area and come back
heroinfield - Looks to be respawning perfectly fine, not following radius set

Edit: Heres a video: https://youtu.be/iPGEQxkg0EM

Plants falling through the floor

When multiple people go to farm coca leaves it becomes very messy not being client sided.

Plants fall through the floor and vanish when running up to them frequently.

Cannot process any drug

Hello, i have some problems with the new update.

the variables "result.ret" and "result.item" are boolean or nil and cannot be processed by the RegisterNetEvent (error on result.ret and if i remove it on result.item), says the same for all other drugs with the news variables.

RegisterNetEvent('ps-drugprocessing:ProcessCocaFarm', function()
	local coords = GetEntityCoords(PlayerPedId())

	if #(coords-Config.CircleZones.CokeProcessing.coords) < 5 then
		if not isProcessing then
			QBCore.Functions.TriggerCallback('ps-drugprocessing:validate_items', function(result)
				if result.ret then
					ProcessCoke()
				else
					QBCore.Functions.Notify(Lang:t("error.no_item", {item = result.item}))
				end
			end, {coca_leaf = Config.CokeProcessing.CokeLeaf, trimming_scissors = 1})
		end
	end
end)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.