From 4db34e5f507e6984ca932add3236d97a4e733b61 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:01:17 -0700 Subject: [PATCH] Update cocaine.lua --- client/cocaine.lua | 90 +++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/client/cocaine.lua b/client/cocaine.lua index b5c58c4..b7d04d1 100644 --- a/client/cocaine.lua +++ b/client/cocaine.lua @@ -1,13 +1,13 @@ local QBCore = exports['qb-core']:GetCoreObject() local CocaPlant = {} local cuttingcoke = nil -local baggingcoke = nil +local baggingcoke = nil -local function pick(loc) -if not progressbar(Lang.Coke.picking, 4000, 'uncuff') then return end -TriggerServerEvent("coke:pickupCane", loc) -return true -end +local function pick(loc) +if not progressbar(Lang.Coke.picking, 4000, 'uncuff') then return end +TriggerServerEvent("coke:pickupCane", loc) +return true +end RegisterNetEvent('coke:respawnCane', function(loc) local v = GlobalState.CocaPlant[loc] @@ -15,7 +15,7 @@ RegisterNetEvent('coke:respawnCane', function(loc) if not CocaPlant[loc] then CocaPlant[loc] = CreateObject(hash, v.location, false, true, true) Freeze(CocaPlant[loc], true, v.heading) - local options = { + local options = { { icon = "fas fa-hand", label = "pick Cocaine", @@ -24,20 +24,20 @@ RegisterNetEvent('coke:respawnCane', function(loc) end } } - local optionsox = { - { - icon = "fas fa-hand", - label = "pick Cocaine", - distance = 2.5, - onselect = function() - if not pick(loc) then return end - end - } - } - if Config.oxtarget then - exports.ox_target:AddLocalEntity(CocaPlant[loc], optionsox) - else - exports['qb-target']:AddTargetEntity(CocaPlant[loc], {options = options, distance = 2.5}) + local optionsox = { + { + icon = "fas fa-hand", + label = "pick Cocaine", + distance = 2.5, + onSelect = function() + if not pick(loc) then return end + end + } + } + if Config.oxtarget then + exports.ox_target:AddLocalEntity(CocaPlant[loc], optionsox) + else + exports['qb-target']:addTargetEntity(CocaPlant[loc], {options = options, distance = 2.5}) end end end) @@ -54,31 +54,31 @@ RegisterNetEvent("coke:init", function() if not v.taken then CocaPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true) Freeze(CocaPlant[k], true, v.heading) - local options = { - { - icon = "fas fa-hand", - label = "pick Cocaine", - action = function() - if not pick(k) then return end - end - } - } - local optionsox = { - { - icon = "fas fa-hand", - label = "pick Cocaine", - distance = 2.5, - onselect = function() - if not pick(k) then return end - end - } - } - if Config.oxtarget then - exports.ox_target:AddLocalEntity(CocaPlant[k], optionsox) - else - exports['qb-target']:AddTargetEntity(CocaPlant[k], {options = options, distance = 2.5}) + local options = { + { + icon = "fas fa-hand", + label = "pick Cocaine", + action = function() + if not pick(k) then return end + end + } + } + local optionsox = { + { + icon = "fas fa-hand", + label = "pick Cocaine", + distance = 2.5, + onselect = function() + if not pick(k) then return end + end + } + } + if Config.oxtarget then + exports.ox_target:AddLocalEntity(CocaPlant[k], optionsox) + else + exports['qb-target']:AddTargetEntity(CocaPlant[k], {options = options, distance = 2.5}) end - end + end end end)