Update cocaine.lua

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-09-17 13:01:17 -07:00
1 parent a8633c2884
commit 4db34e5f50
1 file changed
+45 -45
+45 -45
View File
@@ -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)