- added multi location for coke fancy anims

This commit is contained in:
Mustache Dom committed 2025-06-30 23:24:57 -07:00
1 parent 7422c9d57b
commit 9e84111da3
7 files changed
+109 -114

No files matched your search

+4 -6
View File
@@ -159,13 +159,12 @@ function Tray()
AttachEntityToEntity(trays, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01,-0.2, -0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, true) AttachEntityToEntity(trays, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01,-0.2, -0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, true)
end end
function CutCoke() function CutCoke(coords, offset, rotation)
local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter" local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter"
lib.requestAnimDict(animDict, 500) lib.requestAnimDict(animDict, 500)
local animDuration = GetAnimDuration(animDict, animName) * 1000 local animDuration = GetAnimDuration(animDict, animName) * 1000
local ped = PlayerPedId() local ped = PlayerPedId()
local coords = GetEntityCoords(ped) local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
local scenePos, sceneRot = vector3(1090.37+.9, -3193.61-1.68, -39.60), vector3(0.0, 0.0, 0.00)
local scenes = { local scenes = {
{ {
{ hash = "bkr_prop_coke_bakingsoda_o", animName = "coke_cut_v5_bakingsoda"}, { hash = "bkr_prop_coke_bakingsoda_o", animName = "coke_cut_v5_bakingsoda"},
@@ -214,14 +213,13 @@ CreateThread(function()
BikerCocaine.Details.Enable({BikerCocaine.Details.cokeBasic1, BikerCocaine.Details.cokeBasic2, BikerCocaine.Details.cokeBasic3}, true) BikerCocaine.Details.Enable({BikerCocaine.Details.cokeBasic1, BikerCocaine.Details.cokeBasic2, BikerCocaine.Details.cokeBasic3}, true)
end) end)
function BagCoke() function BagCoke(coords, offset, rotation)
local ver = "" local ver = ""
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01" local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
lib.requestAnimDict(animDict, 500) lib.requestAnimDict(animDict, 500)
local animDuration = GetAnimDuration(animDict, animName) * 1000 local animDuration = GetAnimDuration(animDict, animName) * 1000
local ped = PlayerPedId() local ped = PlayerPedId()
local coords = GetEntityCoords(ped) local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
local scenePos, sceneRot = vector3(1090.62+4.3, -3196.2+3, -38.99-1), vector3(360.0, 360.0, 180.08)
local scenes = { local scenes = {
{ {
{ hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."box01"}, { hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."box01"},
+67 -44
View File
@@ -4,7 +4,7 @@ local baggingcoke = nil
local function pick(loc) local function pick(loc)
if not progressbar(Lang.Coke.picking, 4000, 'uncuff') then return end if not progressbar(Lang.Coke.picking, 4000, 'uncuff') then return end
TriggerServerEvent("coke:pickupCane", loc) TriggerServerEvent("coke:pickupCane", loc)
return true return true
end end
@@ -14,7 +14,15 @@ RegisterNetEvent('coke:respawnCane', function(loc)
if not CocaPlant[loc] then if not CocaPlant[loc] then
CocaPlant[loc] = CreateObject(hash, v.location, false, true, true) CocaPlant[loc] = CreateObject(hash, v.location, false, true, true)
Freeze(CocaPlant[loc], true, v.heading) Freeze(CocaPlant[loc], true, v.heading)
AddSingleModel(CocaPlant[loc], {icon = "fa-solid fa-seedling", label = Lang.targets.coke.pick, action = function() if not pick(loc) then return end end}, loc) ps.entityTarget(CocaPlant[loc], {
{
icon = "fa-solid fa-seedling",
label = Lang.targets.coke.pick,
action = function()
if not pick(loc) then return end
end
}
})
end end
end) end)
@@ -30,7 +38,15 @@ RegisterNetEvent("coke:init", function()
if not v.taken then if not v.taken then
CocaPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true) CocaPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
Freeze(CocaPlant[k], true, v.heading) Freeze(CocaPlant[k], true, v.heading)
AddSingleModel(CocaPlant[k], {icon = "fa-solid fa-seedling", label = Lang.targets.coke.pick, action = function() if not pick(k) then return end end}, k) ps.entityTarget(CocaPlant[k], {
{
icon = "fa-solid fa-seedling",
label = Lang.targets.coke.pick,
action = function()
if not pick(k) then return end
end
}
})
end end
end end
end) end)
@@ -46,45 +62,52 @@ AddEventHandler('onResourceStop', function(resourceName)
end end
end) end)
RegisterNetEvent("md-drugs:client:makepowder", function(data) for k, v in pairs (GlobalState.MDDrugsLocs.MakePowder) do
if not ItemCheck('coca_leaf') then return end ps.boxTarget('cocaplant'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
if not progressbar(Lang.Coke.makepow, 4000, 'uncuff') then return end {
TriggerServerEvent("md-drugs:server:makepowder", data.data) label = Lang.targets.coke.pick,
end) icon = 'fa-solid fa-seedling',
action = function()
if not ps.hasItem('coca_leaf') then return end
if not ps.progressbar(Lang.Coke.makepow, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makepowder", k)
end,
canInteract = function()
return handleGang(v.gang)
end
}
})
end
RegisterNetEvent("md-drugs:client:cutcokeone", function(data) for k, v in pairs (GlobalState.MDDrugsLocs.CuttingCoke) do
if not ItemCheck('bakingsoda') then return end ps.boxTarget('cutcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
cuttingcoke = true {
if Config.FancyCokeAnims then label = 'cutCoke',
CutCoke() icon = 'fa-solid fa-mortar-pestle',
else action = function()
if not progressbar(Lang.Coke.cutting, 5000, 'uncuff') then cuttingcoke = nil return end CutCoke(v.loc, v.offset, v.rotation)
end end,
TriggerServerEvent("md-drugs:server:cutcokeone", data.data) canInteract = function()
cuttingcoke = nil if not handleGang(v.gang) then return false end
end) if cuttingcoke ~= nil or baggingcoke ~= nil then return false end
return true
RegisterNetEvent("md-drugs:client:bagcoke", function(data) end,
if not ItemCheck('empty_weed_bag') then return end }
baggingcoke = true })
if Config.FancyCokeAnims then end
BagCoke() for k, v in pairs (GlobalState.MDDrugsLocs.BaggingCoke) do
else ps.boxTarget('bagcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
if not progressbar(Lang.Coke.bagging, 5000, 'uncuff') then baggingcoke = nil return end {
end label = 'bagCoke',
TriggerServerEvent("md-drugs:server:bagcoke", data.data) icon = 'fa-solid fa-sack-xmark',
baggingcoke = nil action = function()
end) BagCoke(v.loc, v.offset, v.rotation)
end,
CreateThread(function() canInteract = function()
local config = lib.callback.await('md-drugs:server:getLocs', false) if not handleGang(v.gang) then return false end
if Config.FancyCokeAnims == false then if cuttingcoke ~= nil or baggingcoke ~= nil then return false end
AddBoxZoneMulti('cuttcoke', config.CuttingCoke, { type = "client",event = "md-drugs:client:cutcokeone", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.coke.cut}) return true
AddBoxZoneMulti('baggcoke', config.BaggingCoke, { type = "client",event = "md-drugs:client:bagcoke", icon = "fa-solid fa-sack-xmark", label = Lang.targets.coke.bag}) end
else }
AddBoxZoneSingle('cutcoke', config.singleSpot.cutcoke, })
{ data = config.singleSpot.cutcoke, type = "client", event = "md-drugs:client:cutcokeone", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.coke.cut, canInteract = function() if cuttingcoke == nil and baggingcoke == nil then return true end end }) end
AddBoxZoneSingle('bagcokepowder', config.singleSpot.bagcokepowder,
{ data = config.singleSpot.bagcokepowder, type = "client", event = "md-drugs:client:bagcoke", icon = "fa-solid fa-sack-xmark", label = Lang.targets.coke.bag, canInteract = function() if baggingcoke == nil and cuttingcoke == nil then return true end end })
end
end)
+5
View File
@@ -676,3 +676,8 @@ RegisterCommand('DrugRep', function()
lib.showContext('DrugRep') lib.showContext('DrugRep')
end, false) end, false)
function handleGang(gang)
if gang == nil or gang == '' or gang == "" then return true end
if ps.getGangName() == gang or gang == 1 then return true end
return false
end
+23 -31
View File
@@ -50,7 +50,11 @@ end)
RegisterServerEvent('md-drugs:server:makepowder', function(num) RegisterServerEvent('md-drugs:server:makepowder', function(num)
local src = source local src = source
if not checkLoc(src, 'MakePowder', num) then return end ps.debug(#(GetEntityCoords(GetPlayerPed(src)) - GlobalState.MDDrugsLocs.MakePowder[num].loc))
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.MakePowder[num].loc, 3.5) then
Notifys(src, 'You are not in the correct location', 'error')
return
end
local tier = 'tier1' local tier = 'tier1'
if Config.TierSystem then if Config.TierSystem then
local coke = getRep(src, 'coke') local coke = getRep(src, 'coke')
@@ -65,55 +69,44 @@ end)
RegisterServerEvent('md-drugs:server:cutcokeone', function(num) RegisterServerEvent('md-drugs:server:cutcokeone', function(num)
local src = source local src = source
local Player = getPlayer(src) local tier = 'tier1'
local count = 0 if not ps.checkDistance(src, GlobalState.MDDrugsLocs.CuttingCoke[num].loc, 2.5) then
if Config.FancyCokeAnims then Notifys(src, 'You are not in the correct location', 'error')
if not checkLoc(src, 'singleSpot', 'cutcoke') then return end return
else
if not checkLoc(src, 'CuttingCoke', num) then return end
end end
if Config.TierSystem then if Config.TierSystem then
local tier = 'tier1'
local cokeTiers = { local cokeTiers = {
{item = 'coke', tier = 'tier1', log = ' Cut Coke'}, {item = 'coke', tier = 'tier1', log = ' Cut Coke'},
{item = 'cokestagetwo', tier = 'tier2', log = ' Cut Coke tier 2'}, {item = 'cokestagetwo', tier = 'tier2', log = ' Cut Coke tier 2'},
{item = 'cokestagethree', tier = 'tier3', log = ' Cut Coke tier 3'} {item = 'cokestagethree', tier = 'tier3', log = ' Cut Coke tier 3'}
} }
for _, v in ipairs(cokeTiers) do for _, v in ipairs(cokeTiers) do
if count >= 1 then break end if ps.hasItem(src, v.item) then
if Player.Functions.GetItemByName(v.item) then
tier = v.tier tier = v.tier
count = count + 1 break
end end
end end
if not GetRecipe(src, 'cocaine', 'cutcoke', tier) then return end
else
if not GetRecipe(src, 'cocaine', 'cutcoke', 'tier1') then return end
end end
if not GetRecipe(src, 'cocaine', 'cutcoke', tier) then return end
end) end)
RegisterServerEvent('md-drugs:server:bagcoke', function(num) RegisterServerEvent('md-drugs:server:bagcoke', function(num)
local src = source local src = source
local Player = getPlayer(src)
local count = 0
local tier = 'tier1' local tier = 'tier1'
if Config.FancyCokeAnims then if not ps.checkDistance(src, GlobalState.MDDrugsLocs.BaggingCoke[num].loc, 2.5) then
if not checkLoc(src, 'singleSpot', 'bagcokepowder') then return end Notifys(src, 'You are not in the correct location', 'error')
else return
if not checkLoc(src, 'BaggingCoke', num) then return end
end end
if Config.TierSystem then if Config.TierSystem then
local coke = getRep(src, 'coke')
local cokeTiers = { local cokeTiers = {
{item = 'loosecoke', tier = 'tier1', log = ' Bagged Coke'}, {item = 'loosecoke', tier = 'tier1', log = ' Bagged Coke'},
{item = 'loosecokestagetwo', tier = 'tier2', log = ' Bagged Coke tier 2'}, {item = 'loosecokestagetwo', tier = 'tier2', log = ' Bagged Coke tier 2'},
{item = 'loosecokestagethree', tier = 'tier3', log = ' Bagged Coke tier 3'} {item = 'loosecokestagethree', tier = 'tier3', log = ' Bagged Coke tier 3'}
} }
for _, v in ipairs(cokeTiers) do for _, v in ipairs(cokeTiers) do
if Player.Functions.GetItemByName(v.item) then if ps.hasItem(src, v.item) then
if count >= 1 then break end tier = v.tier
count = count + 1 break
tier = v.tier
end end
end end
if not GetRecipe(src, 'cocaine', 'bagcoke', tier) then return end if not GetRecipe(src, 'cocaine', 'bagcoke', tier) then return end
@@ -125,16 +118,15 @@ end)
local cokecut = {loosecokestagetwo = 2, loosecokestagethree = 3} local cokecut = {loosecokestagetwo = 2, loosecokestagethree = 3}
for k, v in pairs (cokecut) do for k, v in pairs (cokecut) do
CUI(k, function(source, item) ps.createUseable(k, function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
if not Player.Functions.GetItemByName('bakingsoda') then Notifys(src, 'You Need Baking Soda For this', 'error') return end if not ps.hasItem(src, 'bakingsoda') then ps.notify(src, 'You Need Baking Soda For this', 'error') return end
if Player.Functions.GetItemByName(item.name) then if ps.hasItem(src,item.name) then
if not Itemcheck(src, 'bakingsoda', 1) then return end
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting It Further') local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting It Further')
if not check then return end if not check then return end
if RemoveItem(src, k, 1) and RemoveItem(src, 'bakingsoda', 1) then if ps.removeItem(src, k, 1) and ps.removeItem(src, 'bakingsoda', 1) then
AddItem(src, 'loosecoke', v) ps.addItem(src, 'loosecoke', v)
end end
end end
end) end)
+7 -6
View File
@@ -1,14 +1,16 @@
local Target = { local Target = {
MakePowder = { -- where you chop your coca leaves to make powder MakePowder = { -- where you chop your coca leaves to make powder
{loc = vector3(1086.20, -3195.30, -39.20), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(1086.20, -3195.30, -39.20), l = 1.0, w = 1.0, rot = 45.0, gang = "ballas"},
{loc = vector3(1090.15, -3199.5, -39.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(1090.15, -3199.5, -39.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(1093.09, -3199.53, -39.05), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(1093.09, -3199.53, -39.05), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
}, },
CuttingCoke = { -- only active if Config.FancyCokeAnims = false CuttingCoke = { -- only active if Config.FancyCokeAnims = false
{loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-1.782227, 0.445068, -0.502701), rotation = vector3(0,0,0), gang = ""},
{loc = vector3(1092.74, -3196.68, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(1.983398, 0.407959, -0.642696), rotation = vector3(0,0,180.0), gang = ""},
}, },
BaggingCoke = { -- only active if Config.FancyCokeAnims = false BaggingCoke = { -- only active if Config.FancyCokeAnims = false
{loc = vector3(1093.16, -3195.78, -39.19), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(1093.16, -3195.78, -39.19), l = 1.0, w = 1.0, rot = 45.0,offset = vec3(4.515137, 2.542969, -0.814194), rotation = vector3(0,0,180.0), gang = ""},
{loc = vector3(1090.17, -3196.59, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-5.207642, -1.666504, -1.014198), rotation = vector3(0,0, 0.0), gang = ""},
}, },
makecrack = { -- make crack with baking soda with cut coke 1-3 makecrack = { -- make crack with baking soda with cut coke 1-3
{loc = vector3(2433.47, 4970.02, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(2433.47, 4970.02, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
@@ -53,8 +55,7 @@ local Target = {
{loc = vector3(2855.62, 4446.73, 48.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(2855.62, 4446.73, 48.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
}, },
singleSpot = { singleSpot = {
cutcoke = vector3(1093.17, -3195.74, -39.19),
bagcokepowder = vector3(1090.28, -3195.65, -39.19),
CokeTeleIn = vector3(198.16, -1276.92, 29.33), -- where you target to go inside coke CokeTeleIn = vector3(198.16, -1276.92, 29.33), -- where you target to go inside coke
CokeTeleOut = vector3(1088.81, -3187.57, -38.99), -- where you target to leave coke CokeTeleOut = vector3(1088.81, -3187.57, -38.99), -- where you target to leave coke
buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), -- buy lab kit for lsd buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), -- buy lab kit for lsd
@@ -110,7 +111,7 @@ local Target = {
vector4(474.88, 2609.56, 44.48, 357.0), vector4(474.88, 2609.56, 44.48, 357.0),
} }
} }
GlobalState.MDDrugsLocs = Target
function checkLoc(source, event, num) function checkLoc(source, event, num)
local ped = source local ped = source
local pos = GetPlayerPed(ped) local pos = GetPlayerPed(ped)
+1 -25
View File
@@ -136,31 +136,7 @@ local recipe = {
} }
function GetRecipe(source, type, method, tier) function GetRecipe(source, type, method, tier)
local src = source ps.craftItem(source,recipe[type][method][tier])
local Player = getPlayer(source)
local has = 0
local need = 0
for k, v in pairs (recipe[type][method][tier].take) do
local item = Player.Functions.GetItemByName(k)
if item and item.amount >= v then
has = has + 1
else
Notifys(src, ' You Need ' .. v .. ' Of ' .. GetLabels(k) .. ' To Do This', 'error')
end
need = need + 1
end
if has == need then
for k, v in pairs (recipe[type][method][tier].take) do
RemoveItem(src, k, v)
end
for k,v in pairs (recipe[type][method][tier].give) do
AddItem(src, k, v)
Log(GetName(src) .. ' Made ' .. GetLabels(k) .. '!', 'drugMaking')
end
return true
else
return false
end
end end
lib.callback.register('md-drugs:server:GetRecipe', function(source, type, cat) lib.callback.register('md-drugs:server:GetRecipe', function(source, type, cat)
+2 -2
View File
@@ -1,5 +1,5 @@
Config = {} --Ignore. Config = {} --Ignore.
ps = exports.ps_lib:init()
Config.respawnTime = 150 -- Seconds Config.respawnTime = 150 -- Seconds
Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn-fuel, LegacyFuel Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn-fuel, LegacyFuel
Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, heroin, crack, lsd) Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, heroin, crack, lsd)
@@ -26,7 +26,7 @@ Config.progressbartype = 'oxcir' -- either 'qb', 'oxcir', 'oxbar'
Config.Notify = 'ox' -- -- either 'qb' or 'ox' or 'okok' Config.Notify = 'ox' -- -- either 'qb' or 'ox' or 'okok'
Config.Phone = 'qb' -- either 'qb' or 'yflip' or 'qs' Config.Phone = 'qb' -- either 'qb' or 'yflip' or 'qs'
Config.Dispatch = 'ps' -- either 'ps', 'cd', 'core', 'aty' Config.Dispatch = 'ps' -- either 'ps', 'cd', 'core', 'aty'
Config.Target = 'ox' -- qb or ox Config.Target = 'qb' -- qb or ox
Config.Inventory = 'ox' -- qb or ox, other if you dont use ox just mark as qb Config.Inventory = 'ox' -- qb or ox, other if you dont use ox just mark as qb
Config.Minigames = { Config.Minigames = {
ps_circle = {amount = 2, speed = 8,}, ps_circle = {amount = 2, speed = 8,},