Impossible to limit inventory
Itâs possible dude. Check in vdkinv.lua :
local maxCapacity = 100
thatâs what I did
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.
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
We could have just three sort of effet :
- Drunk
- High
- Give Health
For items, I have some idea in the head :
- Beer
- Wine
- Whisky/vodka (hard ? :D)
- Cocaine
- Water
ETc⊠Could be a good beginning to start a Grocery/stores script too and can add to gameplay
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
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
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 Can someone help me please?
job_id
in recolt
table should not be NULL
I have change it to NULL because it was a test to resolve it 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