2025-07-15 02:21:34 -07:00
|
|
|
|
2024-01-13 22:23:17 -08:00
|
|
|
local cuttingcoke = nil
|
2024-09-17 13:01:17 -07:00
|
|
|
local baggingcoke = nil
|
2025-07-14 01:34:58 -07:00
|
|
|
|
2025-07-18 01:19:12 -07:00
|
|
|
local function CutCoke(coords, offset, rotation)
|
|
|
|
|
local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter"
|
|
|
|
|
ps.requestAnim(animDict, 500)
|
|
|
|
|
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
|
|
|
|
local ped = PlayerPedId()
|
|
|
|
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
|
|
|
|
|
local scenes = {
|
|
|
|
|
{
|
|
|
|
|
{ hash = "bkr_prop_coke_bakingsoda_o", animName = "coke_cut_v5_bakingsoda"},
|
|
|
|
|
{ hash = "prop_cs_credit_card", animName = "coke_cut_v5_creditcard"},
|
|
|
|
|
{ hash = "prop_cs_credit_card", animName = "coke_cut_v5_creditcard^1"}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
local scenesList, entitiesList = {}, {}
|
|
|
|
|
for i=1, #scenes, 1 do
|
|
|
|
|
local scene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
|
|
|
|
NetworkAddPedToSynchronisedScene(ped, scene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0)
|
|
|
|
|
for j=1, #scenes[i], 1 do
|
|
|
|
|
local s = scenes[i][j]
|
|
|
|
|
RequestModel(s.hash)
|
|
|
|
|
while not HasModelLoaded(s.hash) do
|
|
|
|
|
Wait(0)
|
|
|
|
|
end
|
|
|
|
|
local obj = CreateObjectNoOffset(s.hash, coords, true, true, true)
|
|
|
|
|
SetModelAsNoLongerNeeded(s.hash)
|
|
|
|
|
entitiesList[#entitiesList+1] = obj
|
|
|
|
|
NetworkAddEntityToSynchronisedScene(obj, scene, animDict, s.animName, 4.0, -8.0, 1)
|
|
|
|
|
end
|
|
|
|
|
scenesList[#scenesList+1] = scene
|
|
|
|
|
end
|
|
|
|
|
DisableCamCollisionForEntity(ped)
|
|
|
|
|
FreezeEntityPosition(ped, true)
|
|
|
|
|
for i=1, #scenesList, 1 do
|
|
|
|
|
NetworkStartSynchronisedScene(scenesList[i])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Wait(animDuration-11000)
|
|
|
|
|
for i=1, #scenesList, 1 do
|
|
|
|
|
NetworkStopSynchronisedScene(scenesList[i])
|
|
|
|
|
end
|
|
|
|
|
for i=1, #entitiesList, 1 do
|
|
|
|
|
DeleteEntity(entitiesList[i])
|
|
|
|
|
end
|
|
|
|
|
RemoveAnimDict(animDict)
|
|
|
|
|
FreezeEntityPosition(ped, false)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function BagCoke(coords, offset, rotation)
|
|
|
|
|
local ver = ""
|
|
|
|
|
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
|
|
|
|
ps.requestAnim(animDict, 500)
|
|
|
|
|
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
|
|
|
|
local ped = PlayerPedId()
|
|
|
|
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
|
|
|
|
|
local scenes = {
|
|
|
|
|
{
|
|
|
|
|
{ hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."box01"},
|
|
|
|
|
{ hash = "bkr_prop_coke_fullmetalbowl_02", animName = "break_weigh_"..ver.."box01^1"},
|
|
|
|
|
{ hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."methbag01"}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
{ hash = "xm3_prop_xm3_bag_coke_01a", animName = "break_weigh_"..ver.."methbag01^1"},
|
|
|
|
|
{ hash = "xm3_prop_xm3_bag_coke_01a", animName = "break_weigh_"..ver.."methbag01^2"},
|
|
|
|
|
{ hash = "xm3_prop_xm3_bag_coke_01a", animName = "break_weigh_"..ver.."methbag01^3"}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
{ hash = "bkr_prop_coke_fullscoop_01a", animName = "break_weigh_"..ver.."scoop"},
|
|
|
|
|
{ hash = "bkr_prop_coke_scale_01", animName = "break_weigh_"..ver.."scale"},
|
|
|
|
|
{ hash = "bkr_prop_fakeid_penclipboard", animName = "break_weigh_"..ver.."pen"}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
{ hash = "bkr_prop_fakeid_clipboard_01a", animName = "break_weigh_"..ver.."clipboard"},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
local scenesList, entitiesList = {}, {}
|
|
|
|
|
for i=1, #scenes, 1 do
|
|
|
|
|
local scene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
|
|
|
|
NetworkAddPedToSynchronisedScene(ped, scene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0)
|
|
|
|
|
for j=1, #scenes[i], 1 do
|
|
|
|
|
local s = scenes[i][j]
|
|
|
|
|
RequestModel(s.hash)
|
|
|
|
|
while not HasModelLoaded(s.hash) do
|
|
|
|
|
Wait(0)
|
|
|
|
|
end
|
|
|
|
|
local obj = CreateObjectNoOffset(s.hash, coords, true, true, true)
|
|
|
|
|
SetModelAsNoLongerNeeded(s.hash)
|
|
|
|
|
entitiesList[#entitiesList+1] = obj
|
|
|
|
|
NetworkAddEntityToSynchronisedScene(obj, scene, animDict, s.animName, 4.0, -8.0, 1)
|
|
|
|
|
end
|
|
|
|
|
scenesList[#scenesList+1] = scene
|
|
|
|
|
end
|
|
|
|
|
DisableCamCollisionForEntity(ped)
|
|
|
|
|
FreezeEntityPosition(ped, true)
|
|
|
|
|
for i=1, #scenesList, 1 do
|
|
|
|
|
NetworkStartSynchronisedScene(scenesList[i])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Wait(animDuration-11000)
|
|
|
|
|
for i=1, #scenesList, 1 do
|
|
|
|
|
NetworkStopSynchronisedScene(scenesList[i])
|
|
|
|
|
end
|
|
|
|
|
for i=1, #entitiesList, 1 do
|
|
|
|
|
DeleteEntity(entitiesList[i])
|
|
|
|
|
end
|
|
|
|
|
RemoveAnimDict(animDict)
|
|
|
|
|
FreezeEntityPosition(ped, false)
|
|
|
|
|
end
|
|
|
|
|
|
2025-06-30 23:24:57 -07:00
|
|
|
for k, v in pairs (GlobalState.MDDrugsLocs.MakePowder) do
|
|
|
|
|
ps.boxTarget('cocaplant'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
|
|
|
|
{
|
2025-07-01 03:09:46 -07:00
|
|
|
label = ps.lang('.targets.coke.pick'),
|
2025-06-30 23:24:57 -07:00
|
|
|
icon = 'fa-solid fa-seedling',
|
|
|
|
|
action = function()
|
2025-07-14 01:34:58 -07:00
|
|
|
if not ps.hasItem('coca_leaf') then
|
|
|
|
|
ps.notify('You Need A Coke Leaf')
|
|
|
|
|
return
|
|
|
|
|
end
|
2025-07-01 03:09:46 -07:00
|
|
|
if not ps.progressbar(ps.lang('Coke.makepow'), 4000, 'uncuff') then return end
|
2025-06-30 23:24:57 -07:00
|
|
|
TriggerServerEvent("md-drugs:server:makepowder", k)
|
|
|
|
|
end,
|
|
|
|
|
canInteract = function()
|
|
|
|
|
return handleGang(v.gang)
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
end
|
2024-01-13 22:23:17 -08:00
|
|
|
|
2025-06-30 23:24:57 -07:00
|
|
|
for k, v in pairs (GlobalState.MDDrugsLocs.CuttingCoke) do
|
|
|
|
|
ps.boxTarget('cutcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
|
|
|
|
|
{
|
2025-07-01 03:09:46 -07:00
|
|
|
label = ps.lang('targets.coke.cut'),
|
2025-06-30 23:24:57 -07:00
|
|
|
icon = 'fa-solid fa-mortar-pestle',
|
|
|
|
|
action = function()
|
|
|
|
|
CutCoke(v.loc, v.offset, v.rotation)
|
|
|
|
|
end,
|
|
|
|
|
canInteract = function()
|
|
|
|
|
if not handleGang(v.gang) then return false end
|
|
|
|
|
if cuttingcoke ~= nil or baggingcoke ~= nil then return false end
|
|
|
|
|
return true
|
|
|
|
|
end,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
end
|
2025-07-14 01:34:58 -07:00
|
|
|
|
2025-06-30 23:24:57 -07:00
|
|
|
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}, {
|
|
|
|
|
{
|
2025-07-01 03:09:46 -07:00
|
|
|
label = ps.lang('targets.coke.bag'),
|
2025-06-30 23:24:57 -07:00
|
|
|
icon = 'fa-solid fa-sack-xmark',
|
|
|
|
|
action = function()
|
|
|
|
|
BagCoke(v.loc, v.offset, v.rotation)
|
|
|
|
|
end,
|
|
|
|
|
canInteract = function()
|
|
|
|
|
if not handleGang(v.gang) then return false end
|
|
|
|
|
if cuttingcoke ~= nil or baggingcoke ~= nil then return false end
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
})
|
2025-07-18 01:19:12 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
CreateThread(function()
|
|
|
|
|
BikerCocaine = exports['bob74_ipl']:GetBikerCocaineObject()
|
|
|
|
|
BikerCocaine.Style.Set(BikerCocaine.Style.upgrade)
|
|
|
|
|
BikerCocaine.Security.Set(BikerCocaine.Security.upgrade)
|
|
|
|
|
BikerCocaine.Details.Enable({BikerCocaine.Details.cokeBasic1, BikerCocaine.Details.cokeBasic2, BikerCocaine.Details.cokeBasic3}, true)
|
|
|
|
|
end)
|