Update cocaine.lua

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-08-26 15:49:35 -07:00
1 parent 7e2b23b9bd
commit c9f4e8114b
1 file changed
+28 -11
+28 -11
View File
@@ -1,7 +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
RegisterNetEvent('coke:respawnCane', function(loc)
local v = GlobalState.CocaPlant[loc]
@@ -9,18 +15,30 @@ 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)
exports['qb-target']:AddTargetEntity(CocaPlant[loc], {
options = { {
local options = {
{
icon = "fas fa-hand",
label = "pick Cocaine",
action = function()
if not progressbar(Lang.Coke.picking, 4000, 'uncuff') then return end
TriggerServerEvent("coke:pickupCane", loc)
if not pick(loc) then return end
end
}
},
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], {options = options, distance = 2.5})
else
exports['qb-target']:AddTargetEntity(CocaPlant[loc], {options = options, distance = 2.5})
end
end
end)
@@ -41,9 +59,8 @@ RegisterNetEvent("coke:init", function()
icon = "fas fa-hand",
label = "pick cocaine",
action = function()
if not progressbar(Lang.Coke.picking, 4000, 'uncuff') then return end
TriggerServerEvent("coke:pickupCane", k)
end
if not pick(k) then return end
end
}
},
distance = 2.5