[Release] Harvest/Treatment/Selling Jobs System v1.1

you are the best
thanks a lot

1 Like

Hello I would like to know if possible to attribute a harvest to a trade so that the other trade can not access it? thank you

sorry for my english just use google translate

Hi @Vodkhard,

when I installed the resource it worked fine, but then I did some work on my server and it doesn’t work anymore. I’ve tried some troubleshooting and I’ve noticed the Citizen thread doesn’t get executed for some reason. Consider this part of your script :

-- Constantly check the position of the player
Citizen.CreateThread(function()
	TriggerEvent("mt:missiontext", '~g~ vdk_rec thread working ~s~...', 5000)
    Citizen.Wait(5000)
    while true do
        Citizen.Wait(1)
        near = IsNear()
		TriggerEvent("mt:missiontext", '~g~ Checking position, isNear = ' .. near .. '~s~...', 800)
        if (exports.vdk_inventory:notFull() == true) then
            if (near == 'field' and exports.vdk_inventory:getQuantity(JOBS[jobId].raw_id) < 26) then
                recolt('Récolte', '+1')
            elseif (near == 'treatment' and exports.vdk_inventory:getQuantity(JOBS[jobId].raw_id) > 0) then
                recolt('Traitement', '+1')
            elseif (near == 'seller' and exports.vdk_inventory:getQuantity(JOBS[jobId].treat_id) > 0) then
                recolt('Vente', '-1')
            end
        else
            if (near == 'treatment' and exports.vdk_inventory:getQuantity(JOBS[jobId].raw_id) > 0) then
                recolt('Traitement', '+1')
            elseif (near == 'seller' and exports.vdk_inventory:getQuantity(JOBS[jobId].treat_id) > 0) then
                recolt('Vente', '-1')
            end
        end
    end
end)

You can see I’ve added a MissionText event at line 3, but it never shows up. I assumed the thread never gets created.

  • Can you give me some ideas that I can try to find precisely what is causing the issue?
  • What should I test to know where the problem is coming from?
  • Should I load vdk__recolt and all the resources that it depends on at the end or at the beginning? Would it change something?

Thanks in advance.

Everything is working. You just need a little brain to configure all correctly

1 Like

How to find the x, y, z coordinates to place its Recolt/Treatment/Selling ?

use tools ! like this [Release] Player coords saver to .Txt


please I need help
I dont know what i need to do.

Have you modify something on RTS ?

No I have just add my coordonates and my items ,recolt in phpmyadmin

In this case, I think it isn’t in RTS your problem. Try to check from which script it’s come from

I have search but I have found anything
Do you have a other script for the recolt ?

You can check wether or not the player has the harvest item when he tries to sell somewhere.
For example :

Field n° 1 : recolt a
Field n° 2 : recolt b

If the player tries to sell at “selling point B” something that he gather from A you detect it and not allow him to do so.

Is that clear ? Maybe I did not understand well your question.

OK thank you and can one créder a slim mistletoe(boom) to exchange resource collected(harvested) enter player?

It depends what version of MySQL you have, “INNER” is not require if you have the last version :wink:

else
if (near == 'field' and exports.vdk_inventory:getQuantity(JOBS[jobId].raw_id) > 40) then
recolt('Inventory full'')

Hello :slight_smile:
With the last scripts version (limitations, etc.) this code don’t work anymore right ? Wanna wrote to players when their inventory is full (limitation item reached) Any idea ? :slight_smile:

Impossible to limit inventory

It’s possible dude. Check in vdkinv.lua :

local maxCapacity = 100

that’s what I did

https://pastebin.com/0a91wkPh ^^