Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Police Required For Weedruns #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions client/cl_weedrun.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local hasDropOff = false
local dropOffArea
local deliveryPed
local madeDeal = false
CurrentCops = 0

--- Functions

Expand Down Expand Up @@ -215,11 +216,14 @@ RegisterNetEvent('ps-weedplanting:client:PackageGoodsReceived', function()
end)

RegisterNetEvent('ps-weedplanting:client:ClockIn', function()
if delivering then return end
delivering = true
TriggerEvent('qb-phone:client:CustomNotification', _U('weedrun_delivery_title'), _U('weedrun_delivery_waitfornew'), 'fas fa-cannabis', '#00FF00', 8000)
Wait(math.random(Shared.DeliveryWaitTime[1], Shared.DeliveryWaitTime[2]))
createNewDropOff()
if CurrentCops >= Shared.CopsRequired then
if delivering then return end
delivering = true
TriggerEvent('qb-phone:client:CustomNotification', _U('weedrun_delivery_title'), _U('weedrun_delivery_waitfornew'), 'fas fa-cannabis', '#00FF00', 8000)
Wait(math.random(Shared.DeliveryWaitTime[1], Shared.DeliveryWaitTime[2]))
createNewDropOff()
else
QBCore.Functions.Notify(_U('not_enough_police'), 'error', 2500)
end)

RegisterNetEvent('ps-weedplanting:client:ClockOut', function()
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version 'cerulean'
game 'gta5'
lua54 'yes'

version '1.6.1'
version '1.6.2'
description 'Project Sloth Weedplanting script'
author 'Lionh34rt'

Expand Down
1 change: 1 addition & 0 deletions shared/locales.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ local Locales = {
['enter_weedlab'] = 'Enter Lab',
['exit_weedlab'] = 'Exit Lab',
['police_burn'] = 'Burn the plant and remove pot.',
['not_enough_police'] = 'There is not enough police',
}

function _U(entry)
Expand Down
1 change: 1 addition & 0 deletions shared/sh_shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Shared.WeedItem = 'weedplant_weed'
Shared.PackedWeedItem = 'weedplant_packedweed'
Shared.SusPackageItem = 'weedplant_package'
Shared.LabkeyItem = 'keya' -- Key required to enter the weed lab
Shared.CopsRequired = 2 --how many police is required to start and continue weed runs.

--- Weed Processing | Weed-Lab
Shared.WeedLab = {
Expand Down