- fix up heroin
This commit is contained in:
1 parent
1b29aaa3b0
commit
4fdef3cf30
8 files changed
+795
-476
No files matched your search
+21
-20
@@ -1,27 +1,32 @@
|
||||
local CocaPlant = {}
|
||||
local cuttingcoke = 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 targetOps(loc)
|
||||
return {
|
||||
{
|
||||
icon = "fa-solid fa-seedling",
|
||||
label = ps.lang('targets.coke.pick'),
|
||||
action = function()
|
||||
if not pick(loc) then return end
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
RegisterNetEvent('coke:respawnCane', function(loc)
|
||||
local v = GlobalState.CocaPlant[loc]
|
||||
local hash = GetHashKey(v.model)
|
||||
if not CocaPlant[loc] then
|
||||
CocaPlant[loc] = CreateObject(hash, v.location, false, true, true)
|
||||
Freeze(CocaPlant[loc], true, v.heading)
|
||||
ps.entityTarget(CocaPlant[loc], {
|
||||
{
|
||||
icon = "fa-solid fa-seedling",
|
||||
label = ps.lang('targets.coke.pick'),
|
||||
action = function()
|
||||
if not pick(loc) then return end
|
||||
end
|
||||
}
|
||||
})
|
||||
ps.entityTarget(CocaPlant[loc], targetOps(loc))
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -37,15 +42,7 @@ 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)
|
||||
ps.entityTarget(CocaPlant[k], {
|
||||
{
|
||||
icon = "fa-solid fa-seedling",
|
||||
label = ps.lang('targets.coke.pick'),
|
||||
action = function()
|
||||
if not pick(k) then return end
|
||||
end
|
||||
}
|
||||
})
|
||||
ps.entityTarget(CocaPlant[k], targetOps(k))
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -67,7 +64,10 @@ for k, v in pairs (GlobalState.MDDrugsLocs.MakePowder) do
|
||||
label = ps.lang('.targets.coke.pick'),
|
||||
icon = 'fa-solid fa-seedling',
|
||||
action = function()
|
||||
if not ps.hasItem('coca_leaf') then return end
|
||||
if not ps.hasItem('coca_leaf') then
|
||||
ps.notify('You Need A Coke Leaf')
|
||||
return
|
||||
end
|
||||
if not ps.progressbar(ps.lang('Coke.makepow'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:makepowder", k)
|
||||
end,
|
||||
@@ -94,6 +94,7 @@ for k, v in pairs (GlobalState.MDDrugsLocs.CuttingCoke) do
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
for k, v in pairs (GlobalState.MDDrugsLocs.BaggingCoke) do
|
||||
ps.boxTarget('bagcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
|
||||
{
|
||||
@@ -109,4 +110,4 @@ for k, v in pairs (GlobalState.MDDrugsLocs.BaggingCoke) do
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
+148
-90
@@ -1,115 +1,173 @@
|
||||
local sell = false
|
||||
local sold = false
|
||||
local targbusy = false
|
||||
local inZone = false
|
||||
local active = false
|
||||
local buyers = {}
|
||||
|
||||
local function reset(targ)
|
||||
local function walkAway(targ)
|
||||
FreezeEntityPosition(targ, false)
|
||||
ClearPedTasks(targ)
|
||||
local coords = GetEntityCoords(targ)
|
||||
TaskWanderInArea(targ, coords.x, coords.y, coords.z, 100.0, 2, 10.0)
|
||||
Wait(10000)
|
||||
DeletePed(targ)
|
||||
targbusy = false
|
||||
sold = true
|
||||
active = false
|
||||
end
|
||||
|
||||
local function walkAway(targ)
|
||||
FreezeEntityPosition(targ, false)
|
||||
ClearPedTasks(targ)
|
||||
local coords = GetEntityCoords(targ)
|
||||
TaskWanderInArea(targ, coords.x, coords.y, coords.z, 100.0, 2, 10.0)
|
||||
Wait(10000)
|
||||
DeletePed(targ)
|
||||
targbusy = false
|
||||
active = false
|
||||
end
|
||||
|
||||
local function sellDrug(item, amount, price, targ)
|
||||
PoliceCall(20)
|
||||
targbusy = true
|
||||
if IsPedInAnyVehicle(PlayerPedId(), true) then
|
||||
Notify(Lang.Cornerselling.inveh, 'error')
|
||||
reset(targ)
|
||||
return end
|
||||
if not progressbar(string.format(Lang.Cornerselling.selling, GetLabel(item), price), 4000, 'uncuff') then return end
|
||||
-- PoliceCall(20)
|
||||
if ps.vehicleData() then
|
||||
Notify(ps.lang('Cornerselling.inveh', 'error'))
|
||||
walkAway(targ)
|
||||
return
|
||||
end
|
||||
|
||||
if not ps.progressbar(string.format(ps.lang('Cornerselling.selling', GetLabel(item), price)), 4000, 'uncuff') then walkAway(targ) return end
|
||||
buyers[targ] = 'sold'
|
||||
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, amount, price)
|
||||
reset(targ)
|
||||
walkAway(targ)
|
||||
end
|
||||
|
||||
local function deny(targ)
|
||||
PoliceCall(20)
|
||||
targbusy = true
|
||||
if not progressbar(Lang.Cornerselling.deny, 4000, 'argue5') then return end
|
||||
reset(targ)
|
||||
-- PoliceCall(20)
|
||||
buyers[targ] = 'sold'
|
||||
if not ps.progressbar(ps.lang('Cornerselling.deny'), 4000, 'argue5') then return end
|
||||
walkAway(targ)
|
||||
end
|
||||
|
||||
local function findPed()
|
||||
local targ = nil
|
||||
repeat
|
||||
Wait(100)
|
||||
targ = ps.getNearestPed(GetEntityCoords(PlayerPedId()), 8)
|
||||
|
||||
if IsPedInAnyVehicle(targ, false) or GetEntityHealth(targ) == 0 or not IsPedHuman(targ) then
|
||||
targ = nil
|
||||
end
|
||||
if buyers[targ] then
|
||||
targ = nil
|
||||
end
|
||||
if inZone then
|
||||
targ = nil
|
||||
end
|
||||
until targ ~= nil
|
||||
|
||||
buyers[targ] = true
|
||||
ps.drawText('Waiting For Customer')
|
||||
|
||||
repeat
|
||||
Wait(1000)
|
||||
TaskGoToCoordAnyMeans(targ, GetEntityCoords(PlayerPedId()), 1.0, 0, 0, 0, 0)
|
||||
until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0
|
||||
|
||||
TaskTurnPedToFaceEntity(targ, PlayerPedId(), -1)
|
||||
ps.hideText()
|
||||
CreateThread(function()
|
||||
Wait(45000)
|
||||
walkAway(targ)
|
||||
buyers[targ] = 'sold'
|
||||
end)
|
||||
return targ
|
||||
end
|
||||
|
||||
local function checkItems()
|
||||
local count = 0
|
||||
for k, v in pairs (GlobalState.DrugNames) do
|
||||
if ps.hasItem(v) then
|
||||
count = count + 1
|
||||
break
|
||||
end
|
||||
end
|
||||
if count == 0 then ps.notify(ps.lang('Cornerselling.nodrugs', 'error')) return false end
|
||||
return true
|
||||
end
|
||||
|
||||
function Cornersell()
|
||||
if active then return false end
|
||||
local targ = lib.GetClosestPed(GetEntityCoords(PlayerPedId()), 8)
|
||||
if targ == nil then return end
|
||||
if IsPedInAnyVehicle(targ, false) or GetEntityHealth(targ) == 0 or not IsPedHuman(targ) then return end
|
||||
local data = ps.callback('md-drugs:server:cornerselling:getAvailableDrugs', false, targ)
|
||||
if data.item == 'nothing' then Notify(Lang.Cornerselling.nodrugs, 'error') sell = false FreezeEntityPosition(targ, false) ClearPedTasks(targ) active = false return false end
|
||||
TaskGoToCoordAnyMeans(targ, GetEntityCoords(PlayerPedId()), 1.0, 0, 0, 0, 0)
|
||||
active = true
|
||||
repeat
|
||||
Wait(1000)
|
||||
until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0
|
||||
lib.requestAnimDict("rcmme_tracey1")
|
||||
TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false) FreezeEntityPosition(targ, true)
|
||||
AddMultiModel(data.ped, {
|
||||
{ label = string.format(Lang.targets.CornerSell.sell, data.amount, GetLabel(data.item), data.price), icon ="fa-solid fa-money-bill",
|
||||
action = function() sellDrug(data.item, data.amount, data.price, targ) end,
|
||||
canInteract = function()
|
||||
if not targbusy then return true end end,
|
||||
},
|
||||
{ label = Lang.targets.CornerSell.deny, icon = "fa-solid fa-person-harassing",
|
||||
action = function() deny(targ) end,
|
||||
canInteract = function()
|
||||
if not targbusy then return true end end,
|
||||
if inZone then sell = false return end
|
||||
|
||||
if not sell then
|
||||
return
|
||||
end
|
||||
|
||||
local hasDrugs = checkItems()
|
||||
if not hasDrugs then
|
||||
sell = false
|
||||
return
|
||||
end
|
||||
|
||||
ps.drawText('Searching For Nearby Customers')
|
||||
|
||||
local targ = findPed()
|
||||
local data = ps.callback('md-drugs:server:cornerselling:getAvailableDrugs', targ)
|
||||
|
||||
if data == false then
|
||||
sell = false
|
||||
return
|
||||
end
|
||||
|
||||
if data == 'robbed' then
|
||||
TaskGoStraightToCoord(targ, -1858.232910, -1242.395630, 8.60510, 100.0, -1, 0.0, 0.0)
|
||||
SetPedMoveRateOverride(targ, 10.0)
|
||||
local got = false
|
||||
ps.entityTarget(targ, {
|
||||
{
|
||||
label = "Take Back Drugs",
|
||||
icon ="fa-solid fa-money-bill",
|
||||
action = function()
|
||||
got = true
|
||||
TriggerServerEvent('md-drugs:server:getBackRobbed')
|
||||
Cornersell()
|
||||
end,
|
||||
canInteract = function()
|
||||
if IsEntityDead(targ) and not got then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
}}, nil)
|
||||
local timer = 45
|
||||
repeat
|
||||
Wait(1000)
|
||||
timer = timer - 1
|
||||
until sold or timer == 0
|
||||
if sold then sold = false return true end
|
||||
if timer == 0 then Notify(Lang.Cornerselling.timeout, 'error') targbusy = true walkAway(targ) return false end
|
||||
else
|
||||
ps.requestAnim("rcmme_tracey1")
|
||||
TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false)
|
||||
FreezeEntityPosition(targ, true)
|
||||
ps.entityTarget(data.ped, {
|
||||
{
|
||||
label = string.format(ps.lang('targets.CornerSell.sell', data.amount, GetLabel(data.item), data.price)),
|
||||
icon ="fa-solid fa-money-bill",
|
||||
action = function()
|
||||
sellDrug(data.item, data.amount, data.price, targ)
|
||||
Cornersell()
|
||||
end,
|
||||
canInteract = function()
|
||||
if buyers[targ] ~= 'sold' and sell then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
label = ps.lang('targets.CornerSell.deny'),
|
||||
icon = "fa-solid fa-person-harassing",
|
||||
action = function()
|
||||
deny(targ)
|
||||
walkAway(targ)
|
||||
Cornersell()
|
||||
end,
|
||||
canInteract = function()
|
||||
if buyers[targ] == true and sell then
|
||||
return true
|
||||
end
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent('md-drugs:client:cornerselling', function()
|
||||
if not GetCops(QBConfig.MinimumDrugSalePolice) then return end
|
||||
if inZone then Notify(Lang.Cornerselling.no, 'error') return end
|
||||
local has = ps.callback('md-drugs:server:hasDrugs', false)
|
||||
if has then
|
||||
if sell then
|
||||
TriggerServerEvent('md-drugs:server:cornerselling:stop')
|
||||
Notify(Lang.Cornerselling.stop, 'error')
|
||||
sell = false
|
||||
active = false
|
||||
else
|
||||
sell = true
|
||||
Notify(Lang.Cornerselling.start, 'success')
|
||||
repeat
|
||||
Wait(1000)
|
||||
Cornersell()
|
||||
until not sell
|
||||
end
|
||||
if sell then
|
||||
sell = false
|
||||
ps.hideText()
|
||||
ps.notify(ps.lang('Cornerselling.stopped', 'error'))
|
||||
else
|
||||
Notify(Lang.Cornerselling.nodrugs, 'error')
|
||||
sell = true
|
||||
ps.notify(ps.lang('Cornerselling.started', 'success'))
|
||||
Cornersell()
|
||||
end
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
for k, v in pairs (QBConfig.NoSellZones) do
|
||||
local box = lib.zones.box({ coords = v.loc, size = vec3(v.width, v.length, v.height), rotation = 180.0, debug = false,
|
||||
onEnter = function() inZone = true end, onExit = function() inZone = false end})
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('md-drugs:client:cornerselling:remove', function(ped)
|
||||
DeletePed(ped)
|
||||
for k, v in pairs (QBConfig.NoSellZones) do
|
||||
local box = lib.zones.box({ coords = v.loc, size = vec3(v.width, v.length, v.height), rotation = 180.0, debug = false,
|
||||
onEnter = function() inZone = true end, onExit = function() inZone = false end})
|
||||
end
|
||||
end)
|
||||
+120
-63
@@ -2,20 +2,79 @@ local PoppyPlants = {}
|
||||
local herointable = false
|
||||
local dirty = false
|
||||
|
||||
local function pickher(loc)
|
||||
if not ps.progressbar(Lang.Heroin.pick, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("heroin:pickupCane", loc)
|
||||
end
|
||||
|
||||
local function pickOps(loc)
|
||||
return {
|
||||
{
|
||||
icon = "fa-solid fa-seedling",
|
||||
label = ps.lang('Heroin.pick'),
|
||||
action = function() pickher(loc) end
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
local function createLabKit(coord, head)
|
||||
local heroinlabkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false,false)
|
||||
SetEntityHeading(heroinlabkit, head)
|
||||
PlaceObjectOnGroundProperly(heroinlabkit)
|
||||
AddMultiModel(heroinlabkit, {
|
||||
{data = heroinlabkit, event = "md-drugs:client:heatliquidheroin", icon = "fa-solid fa-temperature-high", label = Lang.targets.heroin.cook, canInteract = function() if not dirty then return true end end},
|
||||
{data = heroinlabkit, event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.up, canInteract = function() if not dirty then return true end end},
|
||||
{data = heroinlabkit, event = "md-drugs:client:cleanheroinlabkit",icon = "fa-solid fa-hand-sparkles",label = Lang.targets.heroin.clean,canInteract = function() if dirty then return true end end}},heroinlabkit)
|
||||
ps.entityTarget(heroinlabkit, {
|
||||
{
|
||||
icon = "fa-solid fa-temperature-high",
|
||||
label = ps.lang('Heroin.cook'),
|
||||
action = function()
|
||||
if not ps.hasItem('emptyvial') then return end
|
||||
if not minigame() then
|
||||
dirty = true
|
||||
TriggerServerEvent("md-drugs:server:failheatingheroin")
|
||||
ps.requestPTFX("core")
|
||||
local heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", heroinlabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
||||
SetParticleFxLoopedAlpha(heroinkit, 3.0)
|
||||
SetPedToRagdoll(PlayerPedId(), 1300, 1300, 0, 0, 0, 0)
|
||||
return end
|
||||
if not ps.progressbar(ps.lang('Heroin.success'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:heatliquidheroin")
|
||||
end,
|
||||
canInteract = function()
|
||||
if not dirty then return true end
|
||||
return false
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = "fas fa-box-circle-check",
|
||||
label = ps.lang('Heroin.up'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('Heroin.pickup'), 4000, 'uncuff') then return end
|
||||
herointable = false
|
||||
DeleteObject(heroinlabkit)
|
||||
TriggerServerEvent("md-drugs:server:getheroinlabkitback")
|
||||
end,
|
||||
canInteract = function()
|
||||
if not dirty then return true end
|
||||
return false
|
||||
end
|
||||
},
|
||||
{
|
||||
event = "md-drugs:client:cleanheroinlabkit",
|
||||
icon = "fa-solid fa-hand-sparkles",
|
||||
label = ps.lang('Heroin.clean'),
|
||||
action = function()
|
||||
if not ps.hasItem('cleaningkit') then return end
|
||||
if not ps.progressbar(ps.lang('Heroin.clean'), 4000, 'clean') then return end
|
||||
local done = ps.callback('removeCleaningkit', false)
|
||||
if done then dirty = false end
|
||||
end,
|
||||
canInteract = function()
|
||||
if dirty then return true end
|
||||
return false
|
||||
end
|
||||
}})
|
||||
end
|
||||
|
||||
local function pickher(loc)
|
||||
if not progressbar(Lang.Heroin.pick, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("heroin:pickupCane", loc)
|
||||
end
|
||||
|
||||
|
||||
RegisterNetEvent('heroin:respawnCane', function(loc)
|
||||
local v = GlobalState.PoppyPlants[loc]
|
||||
@@ -23,7 +82,7 @@ RegisterNetEvent('heroin:respawnCane', function(loc)
|
||||
if not PoppyPlants[loc] then
|
||||
PoppyPlants[loc] = CreateObject(hash, v.location, false, true, true)
|
||||
Freeze(PoppyPlants[loc], true, v.heading)
|
||||
AddSingleModel(PoppyPlants[loc], {icon = "fa-solid fa-seedling", label = Lang.targets.heroin.pick, action = function() pickher(loc) end}, loc )
|
||||
ps.entityTarget(PoppyPlants[loc], pickOps(loc), loc)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -39,7 +98,7 @@ RegisterNetEvent("heroin:init", function()
|
||||
if not v.taken then
|
||||
PoppyPlants[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
|
||||
Freeze(PoppyPlants[k], true, v.heading)
|
||||
AddSingleModel(PoppyPlants[k], {icon = "fa-solid fa-seedling", label = Lang.targets.heroin.pick, action = function() pickher(k) end}, k )
|
||||
ps.entityTarget(PoppyPlants[k], pickOps(k))
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -55,73 +114,71 @@ end)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:dryplant", function(data)
|
||||
if not progressbar(Lang.Heroin.dryout, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:dryplant",data.data)
|
||||
end)
|
||||
for k, v in pairs (GlobalState.MDDrugsLocs.dryplant) do
|
||||
ps.boxTarget('dryHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
{
|
||||
label = ps.lang('targets.heroin.dry'),
|
||||
icon = 'fa-solid fa-temperature-high',
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('Heroin.dryout'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:dryplant", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
return handleGang(v.gang)
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
RegisterNetEvent("md-drugs:client:cutheroin", function(data)
|
||||
if not ItemCheck('bakingsoda') then return end
|
||||
if not progressbar(Lang.Heroin.cutting, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:cutheroin", data.data)
|
||||
end)
|
||||
for k, v in pairs (GlobalState.MDDrugsLocs.cutheroinone) do
|
||||
ps.boxTarget('cutHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
{
|
||||
label = ps.lang('targets.heroin.cut'),
|
||||
icon = 'fa-solid fa-seedling',
|
||||
action = function()
|
||||
if not ps.hasItem('bakingsoda') then return end
|
||||
if not ps.progressbar(ps.lang('Heroin.cutting'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:cutheroin", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
return handleGang(v.gang)
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
RegisterNetEvent("md-drugs:client:buyheroinlabkit", function()
|
||||
if not progressbar(Lang.Heroin.secret, 4000, 'uncuff') then return end
|
||||
if not ps.progressbar(ps.lang('Heroin.secret'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:getheroinlabkit")
|
||||
end)
|
||||
|
||||
ps.registerCallback("md-drugs:client:setheroinlabkit", function()
|
||||
if herointable then
|
||||
Notify(Lang.Heroin.tableout, 'error')
|
||||
if herointable then
|
||||
ps.notify(ps.lang('Heroin.tableout'), 'error')
|
||||
return false
|
||||
else
|
||||
herointable = true
|
||||
local location, head = StartRay()
|
||||
if not location then herointable = false return end
|
||||
if not progressbar(Lang.Heroin.table, 4000, 'uncuff') then return end
|
||||
if not ps.progressbar(ps.lang('Heroin.table'), 4000, 'uncuff') then return end
|
||||
createLabKit(location, head)
|
||||
return true, location
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:heatliquidheroin", function(data)
|
||||
local loc, head = GetEntityCoords(data.data), GetEntityHeading(data.data)
|
||||
if not ItemCheck('emptyvial') then return end
|
||||
if not minigame() then
|
||||
dirty = true
|
||||
TriggerServerEvent("md-drugs:server:failheatingheroin")
|
||||
loadParticle("core")
|
||||
local heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", data.data, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
||||
SetParticleFxLoopedAlpha(heroinkit, 3.0)
|
||||
SetPedToRagdoll(PlayerPedId(), 1300, 1300, 0, 0, 0, 0)
|
||||
return end
|
||||
if not progressbar(Lang.Heroin.success, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:heatliquidheroin")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:cleanheroinlabkit", function(data)
|
||||
if not ItemCheck('cleaningkit') then return end
|
||||
if not progressbar(Lang.Heroin.clean, 4000, 'clean') then return end
|
||||
local done = ps.callback('removeCleaningkit', false)
|
||||
if done then dirty = false end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:deletedirtyheroin", function(data)
|
||||
local location,head = GetEntityCoords(data), GetEntityHeading(data)
|
||||
DeleteObject(data)
|
||||
createLabKit(location, head)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:getheroinkitback", function(data)
|
||||
if not progressbar(Lang.Heroin.pickup, 4000, 'uncuff') then return end
|
||||
herointable = false
|
||||
DeleteObject(data.data)
|
||||
TriggerServerEvent("md-drugs:server:getheroinlabkitback")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:fillneedle", function(data)
|
||||
if not minigame() then TriggerServerEvent("md-drugs:server:failheroin", data.data) return end
|
||||
if not progressbar(Lang.Heroin.needles, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:fillneedle", data.data)
|
||||
end)
|
||||
for k, v in pairs (GlobalState.MDDrugsLocs.fillneedle) do
|
||||
ps.boxTarget('fillNeedle'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
{
|
||||
label = ps.lang('targets.heroin.fill'),
|
||||
icon = 'fa-solid fa-syringe',
|
||||
action = function()
|
||||
if not minigame() then TriggerServerEvent("md-drugs:server:failheroin", k) return end
|
||||
if not ps.progressbar(ps.lang('Heroin.needles'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:fillneedle", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
return handleGang(v.gang)
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
Reference in new issue
Block a user