Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 0eff681

Browse files
Merge pull request #8 from 3RROR-HUB/update-1
Update 1
2 parents c197d41 + 04e51dd commit 0eff681

10 files changed

Lines changed: 260 additions & 93 deletions

File tree

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ For all support questions, ask in our [Discord](https://www.discord.gg/projectsl
88
![image](https://user-images.githubusercontent.com/82112471/221007957-34e1641e-1cc0-469a-8bf1-33315ef1bdf0.png)
99
![image](https://user-images.githubusercontent.com/82112471/221006801-4639fe6e-3a07-4d27-b0e1-90e1134829fd.png)
1010
![image](https://user-images.githubusercontent.com/82112471/221007532-bd50ae14-5927-4d7e-90fb-b2c1c9b0c467.png)
11+
![image](https://user-images.githubusercontent.com/82112471/221007532-bd50ae14-5927-4d7e-90fb-b2c1c9b0c467.png)
12+
![image](https://user-images.githubusercontent.com/107671912/222414486-e789257e-f9f4-4152-a8d0-738be9d13fa7.png)
13+
14+
# Processing Location
15+
16+
/tp 1041.77, -3199.31, -38.16
1117

1218
# Dependencies
1319

@@ -23,12 +29,16 @@ For all support questions, ask in our [Discord](https://www.discord.gg/projectsl
2329

2430
## Add to your qb-core > shared > items.lua
2531
```lua
32+
--- ps-weedplanting
2633
['weedplant_seedm'] = {['name'] = 'weedplant_seedm', ['label'] = 'Male Weed Seed', ['weight'] = 0, ['type'] = 'item', ['image'] = 'weedplant_seed.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Male Weed Seed'},
2734
['weedplant_seedf'] = {['name'] = 'weedplant_seedf', ['label'] = 'Female Weed Seed', ['weight'] = 0, ['type'] = 'item', ['image'] = 'weedplant_seed.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Female Weed Seed'},
28-
['weedplant_branch'] = {['name'] = 'weedplant_branch', ['label'] = 'Weed Branch', ['weight'] = 10000, ['type'] = 'item', ['image'] = 'weedplant_branch.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Weed plant'},
29-
['weedplant_weed'] = {['name'] = 'weedplant_weed', ['label'] = 'Dried Weed', ['weight'] = 100, ['type'] = 'item', ['image'] = 'weedplant_weed.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Weed ready for packaging'},
35+
['weedplant_branch'] = {['name'] = 'weedplant_branch', ['label'] = 'Weed Branch', ['weight'] = 10000, ['type'] = 'item', ['image'] = 'weedplant_branch.png', ['unique'] = true, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Weed plant'},
36+
['weedplant_weed'] = {['name'] = 'weedplant_weed', ['label'] = 'Dried Weed', ['weight'] = 100, ['type'] = 'item', ['image'] = 'weedplant_weed.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Weed ready for packaging'},
3037
['weedplant_packedweed'] = {['name'] = 'weedplant_packedweed', ['label'] = 'Packed Weed', ['weight'] = 100, ['type'] = 'item', ['image'] = 'weedplant_weed.png', ['unique'] = true, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Weed ready for sale'},
3138
['weedplant_package'] = {['name'] = 'weedplant_package', ['label'] = 'Suspicious Package', ['weight'] = 10000, ['type'] = 'item', ['image'] = 'weedplant_package.png', ['unique'] = true, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Suspicious Package'},
39+
['plant_tub'] = {['name'] = 'plant_tub', ['label'] = 'Plant Tub', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'plant_tub.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Pot for planting plants'},
40+
['empty_watering_can'] = {['name'] = 'empty_watering_can', ['label'] = 'Empty Watering Can', ['weight'] = 500, ['type'] = 'item', ['image'] = 'watering_can.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Empty watering can'},
41+
['full_watering_can'] = {['name'] = 'full_watering_can', ['label'] = 'Full Watering Can', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'watering_can.png', ['unique'] = true, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Watering can filled with water for watering plants'},
3242
```
3343
# Credits
3444
* [Lionh34rt](https://github.com/Lionh34rt) | Check out more scripts from Lionh34rt [here.](https://lionh34rt.tebex.io/category/1954119)

client/cl_planting.lua

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ RegisterNetEvent('ps-weedplanting:client:CheckPlant', function(data)
139139
}
140140
})
141141
elseif result.growth == 100 then -- Harvest
142-
if PlayerJob.type == 'leo' and PlayerJob.onduty then
142+
if PlayerJob.type == Shared.CopJob and PlayerJob.onduty then
143143
exports['qb-menu']:openMenu({
144144
{
145145
header = _U('plant_header'),
@@ -190,7 +190,7 @@ RegisterNetEvent('ps-weedplanting:client:CheckPlant', function(data)
190190
})
191191
end
192192
elseif result.gender == 'female' then -- Option to add male seed
193-
if PlayerJob.type == 'leo' and PlayerJob.onduty then
193+
if PlayerJob.type == Shared.CopJob and PlayerJob.onduty then
194194
exports['qb-menu']:openMenu({
195195
{
196196
header = _U('plant_header'),
@@ -262,7 +262,7 @@ RegisterNetEvent('ps-weedplanting:client:CheckPlant', function(data)
262262
})
263263
end
264264
else -- No option to add male seed
265-
if PlayerJob.type == 'leo' and PlayerJob.onduty then
265+
if PlayerJob.type == Shared.CopJob and PlayerJob.onduty then
266266
exports['qb-menu']:openMenu({
267267
{
268268
header = _U('plant_header'),
@@ -427,7 +427,7 @@ RegisterNetEvent('ps-weedplanting:client:FireGoBrrrrrrr', function(coords)
427427
end)
428428

429429
RegisterNetEvent('ps-weedplanting:client:GiveWater', function(entity)
430-
if QBCore.Functions.HasItem(Shared.WaterItem, 1) then
430+
if QBCore.Functions.HasItem(Shared.FullCanItem, 1) then
431431
local netId = NetworkGetNetworkIdFromEntity(entity)
432432
local ped = PlayerPedId()
433433
local coords = GetEntityCoords(ped)
@@ -466,6 +466,48 @@ RegisterNetEvent('ps-weedplanting:client:GiveWater', function(entity)
466466
end
467467
end)
468468

469+
RegisterNetEvent('ps-weedplanting:client:OpenFillWaterMenu', function()
470+
exports['qb-menu']:openMenu({
471+
{
472+
header = _U('empty_watering_can_header'),
473+
txt = _U('esc_to_close'),
474+
icon = 'fas fa-chevron-left',
475+
params = {
476+
event = 'qb-menu:closeMenu'
477+
}
478+
},
479+
{
480+
header = _U('fill_can_header'),
481+
txt = _U('fill_can_text'),
482+
icon = 'fa-solid fa-oil-can',
483+
params = {
484+
event = 'ps-weedplanting:client:FillWater',
485+
}
486+
}
487+
})
488+
end)
489+
490+
RegisterNetEvent('ps-weedplanting:client:FillWater', function()
491+
492+
local hasItem = QBCore.Functions.HasItem(Shared.WaterItem)
493+
494+
if not hasItem then
495+
QBCore.Functions.Notify(_U('missing_filling_water'), 'error', 2500)
496+
return
497+
end
498+
499+
QBCore.Functions.Progressbar('filling_water', _U('filling_water'), 2000, false, true, {
500+
disableMovement = true,
501+
disableCarMovement = true,
502+
disableMouse = false,
503+
disableCombat = true,
504+
}, {}, {}, {}, function()
505+
TriggerServerEvent('ps-weedplanting:server:GetFullWateringCan')
506+
end, function() -- Cancel
507+
QBCore.Functions.Notify(_U('canceled'), 'error', 2500)
508+
end)
509+
end)
510+
469511
RegisterNetEvent('ps-weedplanting:client:GiveFertilizer', function(entity)
470512
if QBCore.Functions.HasItem(Shared.FertilizerItem, 1) then
471513
local netId = NetworkGetNetworkIdFromEntity(entity)

client/cl_processing.lua

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,95 @@
1-
--- Events
1+
local props = {}
22

3-
RegisterNetEvent('ps-weedplanting:client:UseBranch', function()
4-
QBCore.Functions.Progressbar('weedbranch', _U('processing_branch'), 5000, false, true, {
3+
function SpawnWeedProcessProps()
4+
for k, v in pairs(Shared.ProcessingProps) do
5+
props[#props+1] = CreateObject(v.model,vector3(v.coords.x,v.coords.y,v.coords.z-1.00))
6+
SetEntityHeading(props[#props],v.coords.w)
7+
FreezeEntityPosition(props, true)
8+
end
9+
end
10+
11+
CreateThread(function ()
12+
13+
SpawnWeedProcessProps()
14+
15+
exports['qb-target']:AddBoxZone('weedprocess', vector3(1045.4, -3197.62, -38.16), 2.3, 1.0, {
16+
name = 'weedprocess',
17+
heading = 0,
18+
minZ = -41.16,
19+
maxZ = -37.50,
20+
debugPoly = Shared.Debug,
21+
}, {
22+
options = {
23+
{
24+
type = 'client',
25+
event = 'ps-weedplanting:client:ProcessBranch',
26+
icon = 'fa-solid fa-cannabis',
27+
label = _U('process_branch'),
28+
},
29+
{ -- Create Package
30+
type = 'client',
31+
event = 'ps-weedplanting:client:PackDryWeed',
32+
icon = 'fa-solid fa-box',
33+
label = _U('pack_dry_weed'),
34+
}
35+
36+
},
37+
distance = 1.5
38+
})
39+
end)
40+
41+
RegisterNetEvent('ps-weedplanting:client:ProcessBranch', function()
42+
43+
local hasItem = QBCore.Functions.HasItem(Shared.BranchItem, 1)
44+
45+
if not hasItem then
46+
QBCore.Functions.Notify(_U('dont_have_branch'), 'error', 2500)
47+
return
48+
end
49+
50+
local ped = PlayerPedId()
51+
local table = vector4(1045.4, -3197.62, -38.16, 0.0)
52+
53+
TaskTurnPedToFaceCoord(ped, table, 1000)
54+
Wait(1300)
55+
56+
QBCore.Functions.Progressbar('weedbranch', _U('processing_branch'), 12000, false, true, {
557
disableMovement = true,
658
disableCarMovement = true,
759
disableMouse = false,
860
disableCombat = true,
9-
}, {}, {}, {}, function() -- Done
61+
}, { animDict = "mini@repair", anim = "fixing_a_ped", flags = 8, }, {}, {}, function()
1062
TriggerServerEvent('ps-weedplanting:server:ProcessBranch')
1163
end, function() -- Cancel
1264
QBCore.Functions.Notify(_U('canceled'), 'error', 2500)
65+
ClearPedTasks(ped)
1366
end)
1467
end)
1568

16-
RegisterNetEvent('ps-weedplanting:client:UseDryWeed', function()
17-
QBCore.Functions.Progressbar('dryweed', _U('packaging_weed'), 5000, false, true, {
69+
RegisterNetEvent('ps-weedplanting:client:PackDryWeed', function()
70+
71+
local hasItem = QBCore.Functions.HasItem(Shared.WeedItem)
72+
73+
if not hasItem then
74+
QBCore.Functions.Notify(_U('dont_have_enough_dryweed'), 'error', 2500)
75+
return
76+
end
77+
78+
local ped = PlayerPedId()
79+
local table = vector4(1045.4, -3197.62, -38.16, 0.0)
80+
81+
TaskTurnPedToFaceCoord(ped, table, 1000)
82+
Wait(1300)
83+
84+
QBCore.Functions.Progressbar('dryweed', _U('packaging_weed'), 12000, false, true, {
1885
disableMovement = true,
1986
disableCarMovement = true,
2087
disableMouse = false,
2188
disableCombat = true,
22-
}, {}, {}, {}, function() -- Done
89+
}, { animDict = "mini@repair", anim = "fixing_a_ped", flags = 8, }, {}, {}, function()
2390
TriggerServerEvent('ps-weedplanting:server:PackageWeed')
2491
end, function() -- Cancel
2592
QBCore.Functions.Notify(_U('canceled'), 'error', 2500)
93+
ClearPedTasks(ped)
2694
end)
2795
end)

client/cl_weedrun.lua

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ local createNewDropOff = function()
113113
createDropOffBlip(randomLoc)
114114
dropOffArea = CircleZone:Create(randomLoc.xyz, 85.0, {
115115
name = 'dropOffArea',
116-
debugPoly = true
116+
debugPoly = Shared.Debug
117117
})
118118

119119
dropOffArea:onPlayerInOut(function(isPointInside, point)
@@ -186,7 +186,7 @@ RegisterNetEvent('ps-weedplanting:client:StartPackage', function(data)
186186

187187
packageZone = CircleZone:Create(Shared.WeedRunStart.xyz, 10.0, {
188188
name = 'weedrunning_start',
189-
debugPoly = false
189+
debugPoly = Shared.Debug
190190
})
191191

192192
packageZone:onPlayerInOut(function(isPointInside, point)
@@ -241,16 +241,16 @@ RegisterNetEvent('ps-weedplanting:client:DeliverWeed', function()
241241
return
242242
end
243243

244-
local ped = PlayerPedId()
244+
local ped = PlayerPedId()
245245
if not IsPedOnFoot(ped) then return end
246246
if #(GetEntityCoords(ped) - GetEntityCoords(deliveryPed)) < 5.0 then
247247
madeDeal = true
248248
exports['qb-target']:RemoveTargetEntity(deliveryPed)
249249

250250
-- Alert Cops
251251
if math.random(100) <= Shared.CallCopsChance then
252-
if GetResourceState('ps-dispatch') == 'started' then
253-
exports['ps-dispatch']:DrugSale() -- Project-SLoth ps-dispatch
252+
if GetResourceState(Shared.Dispatch) == 'started' then
253+
exports[Shared.Dispatch]:DrugSale() -- Project-SLoth ps-dispatch
254254
end
255255
end
256256

@@ -299,59 +299,61 @@ RegisterNetEvent('ps-weedplanting:client:DeliverWeed', function()
299299
end
300300
end)
301301

302-
--- Threads
303-
304302
CreateThread(function()
305-
exports['qb-target']:SpawnPed({
306-
model = Shared.PedModel,
307-
coords = Shared.WeedRunStart,
308-
minusOne = true,
309-
freeze = true,
310-
invincible = true,
311-
blockevents = true,
312-
animDict = 'anim@mp_celebration@idles@female',
313-
anim = 'celebration_idle_f_a',
314-
flag = 0,
315-
target = {
316-
options = {
317-
{ -- Create Package
318-
type = 'client',
319-
event = 'ps-weedplanting:client:StartPackage',
320-
icon = 'fas fa-circle-chevron-right',
321-
label = _U('package_goods'),
322-
canInteract = function()
323-
return not waitingForPackage
324-
end
325-
},
326-
{ -- Receive Package
327-
type = 'server',
328-
event = 'ps-weedplanting:server:CollectPackageGoods',
329-
icon = 'fas fa-circle-chevron-right',
330-
label = _U('grab_packaged_goods'),
331-
canInteract = function()
332-
return waitingForPackage
333-
end
334-
},
335-
{ -- Clock In for deliveries
336-
type = 'client',
337-
event = 'ps-weedplanting:client:ClockIn',
338-
icon = 'fas fa-stopwatch',
339-
label = _U('start_delivering'),
340-
canInteract = function()
341-
return not delivering
342-
end
343-
},
344-
{ -- Clock out for deliveries
345-
type = 'client',
346-
event = 'ps-weedplanting:client:ClockOut',
347-
icon = 'fas fa-stopwatch',
348-
label = _U('stop_delivering'),
349-
canInteract = function()
350-
return delivering
351-
end
352-
}
303+
local ped = nil
304+
305+
RequestModel(Shared.PedModel) while not HasModelLoaded(Shared.PedModel) do Wait(0) end
306+
ped = CreatePed(0, Shared.PedModel, vector4(Shared.WeedRunStart.x, Shared.WeedRunStart.y, Shared.WeedRunStart.z - 1, Shared.WeedRunStart.w ), false, false)
307+
SetEntityInvincible(ped, true)
308+
SetBlockingOfNonTemporaryEvents(ped, true)
309+
FreezeEntityPosition(ped, true)
310+
TaskStartScenarioInPlace(ped,"WORLD_HUMAN_DRUG_DEALER", -1, true)
311+
312+
exports['qb-target']:AddBoxZone('weed-run-zone', vector3(Shared.WeedRunStart.x, Shared.WeedRunStart.y, Shared.WeedRunStart.z), 0.8, 0.8, {
313+
name = 'weed-run-zone',
314+
heading = Shared.WeedRunStart.w,
315+
minZ = Shared.WeedRunStart.z - 1,
316+
maxZ = Shared.WeedRunStart.z + 1,
317+
debugPoly = Shared.Debug,
318+
}, {
319+
options = {
320+
{ -- Create Package
321+
type = 'client',
322+
event = 'ps-weedplanting:client:StartPackage',
323+
icon = 'fas fa-circle-chevron-right',
324+
label = _U('package_goods'),
325+
canInteract = function()
326+
return not waitingForPackage
327+
end
328+
},
329+
{ -- Receive Package
330+
type = 'server',
331+
event = 'ps-weedplanting:server:CollectPackageGoods',
332+
icon = 'fas fa-circle-chevron-right',
333+
label = _U('grab_packaged_goods'),
334+
canInteract = function()
335+
return waitingForPackage
336+
end
353337
},
354-
distance = 1.5
355-
}
338+
{ -- Clock In for deliveries
339+
type = 'client',
340+
event = 'ps-weedplanting:client:ClockIn',
341+
icon = 'fas fa-stopwatch',
342+
label = _U('start_delivering'),
343+
canInteract = function()
344+
return not delivering
345+
end
346+
},
347+
{ -- Clock out for deliveries
348+
type = 'client',
349+
event = 'ps-weedplanting:client:ClockOut',
350+
icon = 'fas fa-stopwatch',
351+
label = _U('stop_delivering'),
352+
canInteract = function()
353+
return delivering
354+
end
355+
}
356+
},
357+
distance = 1.5
356358
})
357359
end)

images/plant_tub.png

6.74 KB
Loading

images/watering_can.png

9.99 KB
Loading

0 commit comments

Comments
 (0)