From 07fb3caf249114c9f44d9d3f80260e88a84e6a77 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:51:04 -0700 Subject: [PATCH] Update cocaine.lua --- client/cocaine.lua | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/client/cocaine.lua b/client/cocaine.lua index b6d07e7..6de00f6 100644 --- a/client/cocaine.lua +++ b/client/cocaine.lua @@ -54,17 +54,29 @@ 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) - exports['qb-target']:AddTargetEntity(CocaPlant[k], { - options = { { - icon = "fas fa-hand", - label = "pick cocaine", - action = function() - if not pick(k) then return end - end - } - }, - 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], options = options) + else + exports['qb-target']:AddTargetEntity(CocaPlant[k], {options = options, distance = 2.5}) end end end)