Add files via upload
This commit is contained in:
1 parent
7d9d4a030d
commit
f9709311af
20 files changed
+1701
-3894
No files matched your search
+69
-87
@@ -2,10 +2,6 @@ local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local CocaPlant = {}
|
||||
local cuttingcoke = nil
|
||||
local baggingcoke = nil
|
||||
function LoadModel(hash)
|
||||
hash = GetHashKey(hash)
|
||||
lib.requestModel(hash, Config.requestModelTime)
|
||||
end
|
||||
|
||||
RegisterNetEvent('coke:respawnCane', function(loc)
|
||||
local v = GlobalState.CocaPlant[loc]
|
||||
@@ -21,15 +17,8 @@ RegisterNetEvent('coke:respawnCane', function(loc)
|
||||
icon = "fas fa-hand",
|
||||
label = "pick Cocaine",
|
||||
action = function()
|
||||
QBCore.Functions.Progressbar("pick_cane", "picking Cocaine Leaves", 2000, false, true, {
|
||||
disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, },
|
||||
{ animDict = 'amb@prop_human_bum_bin@idle_a', anim = 'idle_a', flags = 47, },
|
||||
{}, {}, function()
|
||||
TriggerServerEvent("coke:pickupCane", loc)
|
||||
ClearPedTasks(PlayerPedId())
|
||||
end, function() -- Cancel
|
||||
ClearPedTasks(PlayerPedId())
|
||||
end)
|
||||
if not progressbar(Lang.Coke.picking, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("coke:pickupCane", loc)
|
||||
end
|
||||
}
|
||||
},
|
||||
@@ -57,15 +46,8 @@ RegisterNetEvent("coke:init", function()
|
||||
icon = "fas fa-hand",
|
||||
label = "pick cocaine",
|
||||
action = function()
|
||||
QBCore.Functions.Progressbar("pick_cane", "picking Cocaine Leaves", 2000, false, true, {
|
||||
disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, },
|
||||
{ animDict = 'amb@prop_human_bum_bin@idle_a', anim = 'idle_a', flags = 47, },
|
||||
{}, {}, function()
|
||||
TriggerServerEvent("coke:pickupCane", k)
|
||||
ClearPedTasks(PlayerPedId())
|
||||
end, function() -- Cancel
|
||||
ClearPedTasks(PlayerPedId())
|
||||
end)
|
||||
if not progressbar(Lang.Coke.picking, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("coke:pickupCane", k)
|
||||
end
|
||||
}
|
||||
},
|
||||
@@ -98,82 +80,82 @@ AddEventHandler('onResourceStop', function(resourceName)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:makepowder")
|
||||
AddEventHandler("md-drugs:client:makepowder", function()
|
||||
TriggerEvent('animations:client:EmoteCommandStart', {'uncuff'})
|
||||
QBCore.Functions.Progressbar("drink_something", "chopping plants to powder", 4000, false, true, {
|
||||
disableMovement = false,
|
||||
disableCarMovement = false,
|
||||
disableMouse = false,
|
||||
disableCombat = true,
|
||||
disableInventory = true,
|
||||
}, {}, {}, {}, function()-- Done
|
||||
TriggerServerEvent("md-drugs:server:makepowder")
|
||||
ClearPedTasks(PlayerPedId())
|
||||
end)
|
||||
RegisterNetEvent("md-drugs:client:makepowder", function(data)
|
||||
if not ItemCheck('coca_leaf') then return end
|
||||
if not progressbar(Lang.Coke.makepow, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:makepowder", data.data)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:cutcokeone")
|
||||
AddEventHandler("md-drugs:client:cutcokeone", function()
|
||||
RegisterNetEvent("md-drugs:client:cutcokeone", function()
|
||||
if not ItemCheck('bakingsoda') then return end
|
||||
cuttingcoke = true
|
||||
CutCoke()
|
||||
if Config.FancyCokeAnims then
|
||||
CutCoke()
|
||||
else
|
||||
if not progressbar(Lang.Coke.cutting, 5000, 'uncuff') then cuttingcoke = nil return end
|
||||
end
|
||||
TriggerServerEvent("md-drugs:server:cutcokeone")
|
||||
ClearPedTasks(PlayerPedId())
|
||||
cuttingcoke = nil
|
||||
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:bagcoke")
|
||||
AddEventHandler("md-drugs:client:bagcoke", function()
|
||||
RegisterNetEvent("md-drugs:client:bagcoke", function()
|
||||
if not ItemCheck('empty_weed_bag') then return end
|
||||
baggingcoke = true
|
||||
BagCoke()
|
||||
if Config.FancyCokeAnims then
|
||||
BagCoke()
|
||||
else
|
||||
if not progressbar(Lang.Coke.bagging, 5000, 'uncuff') then baggingcoke = nil return end
|
||||
end
|
||||
TriggerServerEvent("md-drugs:server:bagcoke")
|
||||
ClearPedTasks(PlayerPedId())
|
||||
baggingcoke = nil
|
||||
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
local cut = vector3(1093.01, -3194.8, -39.99)
|
||||
local bagg = vector3(1090.70, -3195.91, -39.99)
|
||||
exports['qb-target']:AddBoxZone("cutcokepowder",vector3(cut.x, cut.y, cut.z),1.5, 1.75, { -- 963.37, -2122.95, 31.47
|
||||
name = "cutcokepowder",
|
||||
heading = 11.0,
|
||||
debugPoly = false,
|
||||
minZ = cut.z-1,
|
||||
maxZ = cut.z+1,
|
||||
}, {
|
||||
options = {
|
||||
{
|
||||
type = "client",
|
||||
event = "md-drugs:client:cutcokeone",
|
||||
icon = "fas fa-sign-in-alt",
|
||||
label = "cut up",
|
||||
canInteract = function()
|
||||
if cuttingcoke == nil and baggingcoke == nil then return true end
|
||||
end
|
||||
},
|
||||
},
|
||||
distance = 2.5
|
||||
})
|
||||
exports['qb-target']:AddBoxZone("bagcokepowder",vector3(bagg.x, bagg.y, bagg.z),1.5, 1.75, { -- 963.37, -2122.95, 31.47
|
||||
name = "bagcokepowder",
|
||||
heading = 11.0,
|
||||
debugPoly = false,
|
||||
minZ = bagg.z-1,
|
||||
maxZ = bagg.z+1,
|
||||
}, {
|
||||
options = {
|
||||
{
|
||||
type = "client",
|
||||
event = "md-drugs:client:bagcoke",
|
||||
icon = "fas fa-sign-in-alt",
|
||||
label = "bagging",
|
||||
canInteract = function()
|
||||
if baggingcoke == nil and cuttingcoke == nil then return true end
|
||||
end
|
||||
},
|
||||
},
|
||||
distance = 2.5
|
||||
})
|
||||
end)
|
||||
local options = {
|
||||
{ type = "client", event = "md-drugs:client:cutcokeone", icon = "fas fa-sign-in-alt", label = "cut up", canInteract = function()
|
||||
if cuttingcoke == nil and baggingcoke == nil then return true end
|
||||
end
|
||||
},
|
||||
}
|
||||
local options2 = {
|
||||
{ type = "client", event = "md-drugs:client:bagcoke", icon = "fas fa-sign-in-alt", label = "bagging", canInteract = function()
|
||||
if baggingcoke == nil and cuttingcoke == nil then return true end end }, }
|
||||
if Config.OxTarget then
|
||||
exports.ox_target:addBoxZone({coords = vector3(1093.17, -3195.74, -39.19 -1), size = vec3(1,1,1), options = options})
|
||||
exports.ox_target:addBoxZone({coords = vector3(1093.17, -3195.74, -39.19 -1), size = vec3(1,1,1), options = options2})
|
||||
else
|
||||
exports['qb-target']:AddBoxZone("cutcokepowder",vector3(1093.17, -3195.74, -39.19 -1),1.5, 1.75, {name = "cutcokepowder", minZ = -40.0,maxZ = -38.0,}, { options = options, distance = 2.0 })
|
||||
exports['qb-target']:AddBoxZone("bagcokepowder",vector3(1090.29, -3195.66, -39.13 - 1),1.5, 1.75, {name = "bagcokepowder", minZ = -40, maxZ = -38,}, {options = options2, distance = 2.0})
|
||||
end
|
||||
if Config.FancyCokeAnims == false then
|
||||
for k, v in pairs (Config.CuttingCoke) do
|
||||
if v.gang == nil or v.gang == '' or v.gang == "" then v.gang = 1 end
|
||||
local options = {
|
||||
{ type = "client", event = "md-drugs:client:cutcokeone", icon = "fas fa-sign-in-alt", label = "Cut Coke", data = k, distance = 2.0,
|
||||
canInteract = function()
|
||||
if QBCore.Functions.GetPlayerData().gang.name == v.gang or v.gang == 1 then return true end end
|
||||
},
|
||||
}
|
||||
if Config.oxtarget then
|
||||
exports.ox_target:addBoxZone({coords = v.loc, size = vec3(1,1,1),debugPoly = false,rotation = v.rot, options = options,})
|
||||
else
|
||||
exports['qb-target']:AddBoxZone("cutcoke"..k ,vector3(v.loc.x, v.loc.y, v.loc.z), v.l, v.w, {name ="cutcoke"..k, heading = 156.0,minZ = v.loc.z-1, maxZ = v.loc.z+1, }, {options = options, distance = 1.5})
|
||||
end
|
||||
end
|
||||
for k, v in pairs (Config.BaggingCoke) do
|
||||
if v.gang == nil or v.gang == '' or v.gang == "" then v.gang = 1 end
|
||||
local options = {
|
||||
{ type = "client", event = "md-drugs:client:bagcoke", icon = "fas fa-sign-in-alt", label = "Bag Coke", data = k, distance = 2.0,
|
||||
canInteract = function()
|
||||
if QBCore.Functions.GetPlayerData().gang.name == v.gang or v.gang == 1 then return true end end
|
||||
},
|
||||
}
|
||||
if Config.oxtarget then
|
||||
exports.ox_target:addBoxZone({coords = v.loc, size = vec3(1,1,1),debugPoly = false,rotation = v.rot, options = options,})
|
||||
else
|
||||
exports['qb-target']:AddBoxZone("bagcoke"..k ,vector3(v.loc.x, v.loc.y, v.loc.z), v.l, v.w, {name ="bagcoke"..k, heading = 156.0,minZ = v.loc.z-1, maxZ = v.loc.z+1, }, {options = options, distance = 1.5})
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
Reference in new issue
Block a user