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

Impossible to limit inventory

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

local maxCapacity = 100

that’s what I did

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

I post my question here, maybe it could be a good thing :

Someone know how to create “Usable Items” ? Example :

if someone use Weed, Beer, Wine (that is harvested) from the inventory, it give him health or he can be drunk/high.
With that, a possibilty to Give or Use in the inventory system is needed.

:slight_smile:

It’s complicated, you have to change db to know which item is usable and what is the wanted effect and after you modify the menu with a different callback function who apply wanted effect of the item. If you are not a developper it will be complicated :wink:

1 Like

We could have just three sort of effet :

  • Drunk
  • High
  • Give Health

For items, I have some idea in the head :slight_smile: :

  • Beer
  • Wine
  • Whisky/vodka (hard ? :D)
  • Cocaine
  • Water

ETc
 :slight_smile: Could be a good beginning to start a Grocery/stores script too and can add to gameplay :slight_smile:

But as you said, i’m not very good at Develloping, I just give ideas that i see, i think, and maybe one good dev take the bet :slight_smile:

2 Likes

I have no clue why, but i can’t get the inventory to work with recolt

I just took your code, didn’t touch anything but the config.lua and i have shitloads of errors in the server logs when i start to recolt.

It seems items doesn’t talk with users_inventory (even tho i did no mistakes installing the dbs)

Try changing the order in which the addons are loaded in the server config file.

[FR] Salut!

J’ai une petite solution pour celui qui voudrait cacher les “Blips” illĂ©gaux et montrer les “Blips” lĂ©gaux.

Ouvrer le fichier FivM_Serveur_BrK_1.1\resources\vdk_recoltvdkrec.lua changez les lignes (Faire disparaitre les “Blips” de vdk_recolt) :

AddEventHandler(“cli:getJobs”, function(listJobs)
JOBS = listJobs
Citizen.CreateThread(function()
for _, item in pairs(JOBS) do
setBlip(item.fx, item.fy, item.fz, 17)
setBlip(item.tx, item.ty, item.tz, 18)
setBlip(item.sx, item.sy, item.sz, 19)
end
end)
end)

Par :

AddEventHandler(“cli:getJobs”, function(listJobs)
JOBS = listJobs
Citizen.CreateThread(function()
for _, item in pairs(JOBS) do
setBlip.hidden(item.fx, item.fy, item.fz, 17)
setBlip.hidden(item.tx, item.ty, item.tz, 18)
setBlip.hidden(item.sx, item.sy, item.sz, 19)
end
end)
end)

Et dans le fichier FivM_Serveur_BrK_1.1\resources\es_ freeroam\player\map.lua ajouter les lignes (Afficher les “Blips” lĂ©gaux) :

  --POUR EXEMPLE--	
  --VIGNOBLE--

{name=“Vignes”, id=85, x=-1822.03283691406, y=2133.42504882813, z=124.669364929199},
{name=“Mise en Tonneau”, id=365, x=-675.3134765625, y=5789.08642578125, z=17.3309478759766},
{name=“Revente de Tonneau”, id=369, x=1204.60424804688, y=-3101.9892578125, z=5.8937349319458},

Merci pour cette release @Vodkhard

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[EN] Hello!

I have a small solution for anyone who would like to hide the illegal “Blips” and show the legal “Blips”.

Open the file FivM_Server_BrK_1.1 \ resources \ vdk_recoltvdkrec.lua change the lines (Make disappear the “Blips” of vdk_recolt):

AddEventHandler(“cli:getJobs”, function(listJobs)
JOBS = listJobs
Citizen.CreateThread(function()
for _, item in pairs(JOBS) do
setBlip(item.fx, item.fy, item.fz, 17)
setBlip(item.tx, item.ty, item.tz, 18)
setBlip(item.sx, item.sy, item.sz, 19)
end
end)
end)

By :

AddEventHandler(“cli:getJobs”, function(listJobs)
JOBS = listJobs
Citizen.CreateThread(function()
for _, item in pairs(JOBS) do
setBlip.hidden(item.fx, item.fy, item.fz, 17)
setBlip.hidden(item.tx, item.ty, item.tz, 18)
setBlip.hidden(item.sx, item.sy, item.sz, 19)
end
end)
end)

And in the file FivM_Serveur_BrK_1.1 \ resources \ es_ freeroam \ player \ map.lua add lines (Show legal “Blips”):

  --FOR EXEMPLE--	
  --VIGNOBLE--

{name=“Vignes”, id=85, x=-1822.03283691406, y=2133.42504882813, z=124.669364929199},
{name=“Mise en Tonneau”, id=365, x=-675.3134765625, y=5789.08642578125, z=17.3309478759766},
{name=“Revente de Tonneau”, id=369, x=1204.60424804688, y=-3101.9892578125, z=5.8937349319458},

Thanks for this release @Vodkhard

Tested this. The code seems unreliable, if you harvest at one place, then start sprinting out of harvest zone, you’ll randomly get another resource in your inventory.

Hi guys ! I have a question for you, I would like to modify your script to have in my server one enterprise for example and who just some people can recolt, treat and send this items.
For example, I can set a new row in my database to set permissions to entreprise number 1 but I don’t know how to set this in the script. Have you got some idea ?

Thanks in advance ! See ya :slight_smile:

reaaly good script but how to change the name of the blips please?? I can change the id blip but not the name there’s only the blip but no name for these

Hello, I have done all correctly, but I don’t see the message to recolt, I have added coordinates, items, and bind all primary keys in the recolt table in mysql, but nothing work :confused: Can someone help me please?

job_id in recolt table should not be NULL :wink:

I have change it to NULL because it was a test to resolve it :confused: I don’t know if it can be the source of my problem but for get the coordonates, I get them with this program :

RegisterNetEvent(“SaveCommand”)
AddEventHandler(“SaveCommand”, function()
** x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))**
** local PlayerName = GetPlayerName()**
** TriggerServerEvent(“SaveCoords”, PlayerName , x , y , z) **
**end) **

this:

print(“Write /pos ingame to save the coords in a .txt in server’s main folder”)

RegisterServerEvent(“SaveCoords”)
AddEventHandler(“SaveCoords”, function( PlayerName , x , y , z )
** file = io.open( PlayerName 
 “-Coords.txt”, “a”)**
** if file then**
** file:write("{" 
 x 
 “,” 
 y 
 “,” 
 z 
 “},”)**
** file:write("\n")**
** end**
** file:close()**
end)

AddEventHandler(“chatMessage”, function(p, color, msg)
** if msg:sub(1, 1) == “/” then**
** fullcmd = stringSplit(msg, " ")**
** cmd = fullcmd[1]**

** if cmd == “/pos” then**
** TriggerClientEvent(“SaveCommand”, p)**
** CancelEvent()**
** end**
** end**
end)

function stringSplit(self, delimiter)
** local a = self:Split(delimiter)**
** local t = {}**

** for i = 0, #a - 1 do**
** table.insert(t, a[i])**
** end**

** return t**
end

PS: I have download vdk_inventory + recolt the 1 may, I don’t think it’s the version, and I have all requirement

If you don’t show me a console error I can’t help you, I already told that and for the coordinator saver it’s not my script so I don’t know

Hi! I’d like to know how to block the harvest for people whom the job does not correspond to what they try to collect.

Will be present in my next Release :wink: