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

I rename them to vdk_inventory it works ^^

but There is no more the inventory by pressing “K”

SOLUTION: Remove the “master” from both folders

hi first of all thank you for this great release.
The script works fine but i have an idea to make it better :
You should store the kind of blips we want to display on the map in the database to let people choose which on they want.

In your vdk_recolt/vdkrec.lua, the function setBlip() could get the blip from the database to display it.

1 Like

thx work perfectly
When you take the time to understand the installation :wink:

1 Like

I have this folder in the folder ressources :

I changed this

Citizen.CreateThread(function()
    Citizen.Wait(5000)
    while true do
        Citizen.Wait(1)
        near = IsNear()
        if ((exports.vdk_inventory:notFull() == true) and (exports.vdk_inventory:getQuantity(JOBS[jobId].raw_id) < 32)) then
            if (near == 'field') 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)

To have my general inventory set to 100 and my item inventory set to 32…:slight_smile:

3 Likes

One thing need to be set uo ASAP…Farmer can harvest Copper…If you see what I mean

2 Likes

The problems come dear you, me the treatment works well

I think that’s random. Some people have problems that others don’t have. MySQL problems are just dumb problems. But problems linked to the script is another thing…

2 Likes

Suggestion : Add a ped which we can intecract with him to sell items (like in AltisLife on Arma 3), for farming, make a condition if the player has not the good job he can’t farm.

2 Likes

That’s a Good idea :slight_smile:

How to ensure that when choosing a craft in the indicated area (minor example), 2 icons appear to allow to visualize the harvest and sale zone

1 Like

The text does not

function recolt(text, rl)
    if (text == 'Récolte') then
        TriggerEvent("mt:missiontext", text .. ' en cours de ~g~' .. tostring(JOBS[jobId].raw_item) .. '~s~...', timeForRecolt - 800)
        Citizen.Wait(timeForRecolt - 800)
        TriggerEvent("player:receiveItem", tonumber(JOBS[jobId].raw_id), 1)
        TriggerEvent("mt:missiontext", rl .. ' ~g~' .. tostring(JOBS[jobId].raw_item) .. '~s~...', 800)
    elseif (text == 'Traitement') then
        TriggerEvent("mt:missiontext", text .. ' en cours de ~g~' .. tostring(JOBS[jobId].raw_item) .. '~s~...', timeForRecolt - 800)
        Citizen.Wait(timeForRecolt - 800)
        TriggerEvent("player:looseItem", tonumber(JOBS[jobId].raw_id), 1)
        TriggerEvent("player:receiveItem", tonumber(JOBS[jobId].treat_id), 1)
        TriggerEvent("mt:missiontext", rl .. ' ~g~' .. tostring(JOBS[jobId].treat_item) .. '~s~...', 800)
    elseif (text == 'Vente') then
        TriggerEvent("mt:missiontext", text .. ' en cours de ~g~' .. tostring(JOBS[jobId].treat_item) .. '~s~...', timeForRecolt - 800)
        Citizen.Wait(timeForRecolt - 800)
        TriggerEvent("player:sellItem", tonumber(JOBS[jobId].treat_id), tonumber(JOBS[jobId].price))
        TriggerEvent("mt:missiontext", rl .. ' ~g~' .. tostring(JOBS[jobId].treat_item) .. '~s~...', 800)
    end
    Citizen.Wait(800)
end

Any ideas ? :’(

hi i’m trying to add marker on my working zone using

DrawMarker(1, position.x, position.y, position.z - 1, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 1.5001, 0, 255, 0,155, 0,0, 0,0)

to be able to delete those blips on illégal field for example.

any idea of where i should put this?

I was thinking to put this here in vdk_recolt.lua :

– Get the list of all jobs in the database and create the blip associated
AddEventHandler(“cli:getJobs”, function(listJobs)
JOBS = listJobs
Citizen.CreateThread(function()
for _, item in pairs(JOBS) do
– setBlip(item.fx, item.fy, item.fz, 17)
DrawMarker(1, item.fx, item.fy, item.fz, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 1.5001, 0, 0, 0,155, 0,0, 0,0)
– setBlip(item.tx, item.ty, item.tz, 18)
DrawMarker(1, item.tx, item.ty, item.tz, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 1.5001, 0, 0, 0,155, 0,0, 0,0)
– setBlip(item.sx, item.sy, item.sz, 19)
DrawMarker(1, item.sx, item.sy, item.sz, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 1.5001, 0, 0, 0,155, 0,0, 0,0)
end
end)
end)

But it doesn’t works any idea?

You have a message text for recolt ?

Me? yes i have one you think i should put my marker there?

No I just said that when I’m on the harvest site I have no message written down the screen as what I am currently harvesting

you should have one without modify the script

Does the inventory limit work for you ? (don’t work for me)

Same for me… I done everything the release said but the error is everytime here…