lots of shit

This commit is contained in:
Mustache Dom committed 2025-07-01 03:09:46 -07:00
1 parent 9e84111da3
commit 1b29aaa3b0
37 files changed
+398 -363

No files matched your search

+2 -2
View File
@@ -366,7 +366,7 @@ end
local hit = 0 local hit = 0
function SpawnCarPedChase() function SpawnCarPedChase()
local stoploc = vector3(-1157.63, -3056.71, 13.94) local stoploc = vector3(-1157.63, -3056.71, 13.94)
local config = lib.callback.await('md-drugs:server:getLocs', false) local config = ps.callback('md-drugs:server:getLocs', false)
local start = config.StartLoc[math.random(1,#config.StartLoc)] local start = config.StartLoc[math.random(1,#config.StartLoc)]
if started then if started then
Notify(Lang.lean.act,'error') Notify(Lang.lean.act,'error')
@@ -413,7 +413,7 @@ end
function SpawnMethCarPedChase() function SpawnMethCarPedChase()
local ped = GetEntityCoords(PlayerPedId()) local ped = GetEntityCoords(PlayerPedId())
local stoploc = vector3(-1157.63, -3056.71, 13.94) local stoploc = vector3(-1157.63, -3056.71, 13.94)
local config = lib.callback.await('md-drugs:server:getLocs', false) local config = ps.callback('md-drugs:server:getLocs', false)
local start = config.StartLoc[math.random(1,#config.StartLoc)] local start = config.StartLoc[math.random(1,#config.StartLoc)]
local startedmeth = false local startedmeth = false
+7 -8
View File
@@ -1,7 +1,6 @@
local CocaPlant = {} local CocaPlant = {}
local cuttingcoke = nil local cuttingcoke = nil
local baggingcoke = nil 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)
@@ -17,7 +16,7 @@ RegisterNetEvent('coke:respawnCane', function(loc)
ps.entityTarget(CocaPlant[loc], { ps.entityTarget(CocaPlant[loc], {
{ {
icon = "fa-solid fa-seedling", icon = "fa-solid fa-seedling",
label = Lang.targets.coke.pick, label = ps.lang('targets.coke.pick'),
action = function() action = function()
if not pick(loc) then return end if not pick(loc) then return end
end end
@@ -34,14 +33,14 @@ end)
RegisterNetEvent("coke:init", function() RegisterNetEvent("coke:init", function()
for k, v in pairs (GlobalState.CocaPlant) do for k, v in pairs (GlobalState.CocaPlant) do
local hash = GetHashKey(v.model) local hash = GetHashKey(v.model)
LoadModel(hash) ps.requestModel(hash)
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)
ps.entityTarget(CocaPlant[k], { ps.entityTarget(CocaPlant[k], {
{ {
icon = "fa-solid fa-seedling", icon = "fa-solid fa-seedling",
label = Lang.targets.coke.pick, label = ps.lang('targets.coke.pick'),
action = function() action = function()
if not pick(k) then return end if not pick(k) then return end
end end
@@ -65,11 +64,11 @@ end)
for k, v in pairs (GlobalState.MDDrugsLocs.MakePowder) do 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}, { ps.boxTarget('cocaplant'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = Lang.targets.coke.pick, label = ps.lang('.targets.coke.pick'),
icon = 'fa-solid fa-seedling', icon = 'fa-solid fa-seedling',
action = function() action = function()
if not ps.hasItem('coca_leaf') then return end if not ps.hasItem('coca_leaf') then return end
if not ps.progressbar(Lang.Coke.makepow, 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('Coke.makepow'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makepowder", k) TriggerServerEvent("md-drugs:server:makepowder", k)
end, end,
canInteract = function() canInteract = function()
@@ -82,7 +81,7 @@ end
for k, v in pairs (GlobalState.MDDrugsLocs.CuttingCoke) do 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}, { ps.boxTarget('cutcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
{ {
label = 'cutCoke', label = ps.lang('targets.coke.cut'),
icon = 'fa-solid fa-mortar-pestle', icon = 'fa-solid fa-mortar-pestle',
action = function() action = function()
CutCoke(v.loc, v.offset, v.rotation) CutCoke(v.loc, v.offset, v.rotation)
@@ -98,7 +97,7 @@ end
for k, v in pairs (GlobalState.MDDrugsLocs.BaggingCoke) do 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}, { ps.boxTarget('bagcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
{ {
label = 'bagCoke', label = ps.lang('targets.coke.bag'),
icon = 'fa-solid fa-sack-xmark', icon = 'fa-solid fa-sack-xmark',
action = function() action = function()
BagCoke(v.loc, v.offset, v.rotation) BagCoke(v.loc, v.offset, v.rotation)
+1 -1
View File
@@ -1,6 +1,6 @@
lib.callback.register('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item) ps.registerCallback('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item)
if not progressbar(progresstext .. GetLabel(item).. "!", time, anim ) then return end if not progressbar(progresstext .. GetLabel(item).. "!", time, anim ) then return end
for k, v in pairs (status) do for k, v in pairs (status) do
if k == 'health' then if k == 'health' then
+2 -2
View File
@@ -51,7 +51,7 @@ function Cornersell()
local targ = lib.GetClosestPed(GetEntityCoords(PlayerPedId()), 8) local targ = lib.GetClosestPed(GetEntityCoords(PlayerPedId()), 8)
if targ == nil then return end if targ == nil then return end
if IsPedInAnyVehicle(targ, false) or GetEntityHealth(targ) == 0 or not IsPedHuman(targ) then return end if IsPedInAnyVehicle(targ, false) or GetEntityHealth(targ) == 0 or not IsPedHuman(targ) then return end
local data = lib.callback.await('md-drugs:server:cornerselling:getAvailableDrugs', false, targ) 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 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) TaskGoToCoordAnyMeans(targ, GetEntityCoords(PlayerPedId()), 1.0, 0, 0, 0, 0)
active = true active = true
@@ -83,7 +83,7 @@ end
RegisterNetEvent('md-drugs:client:cornerselling', function() RegisterNetEvent('md-drugs:client:cornerselling', function()
if not GetCops(QBConfig.MinimumDrugSalePolice) then return end if not GetCops(QBConfig.MinimumDrugSalePolice) then return end
if inZone then Notify(Lang.Cornerselling.no, 'error') return end if inZone then Notify(Lang.Cornerselling.no, 'error') return end
local has = lib.callback.await('md-drugs:server:hasDrugs', false) local has = ps.callback('md-drugs:server:hasDrugs', false)
if has then if has then
if sell then if sell then
TriggerServerEvent('md-drugs:server:cornerselling:stop') TriggerServerEvent('md-drugs:server:cornerselling:stop')
+36 -11
View File
@@ -1,12 +1,37 @@
RegisterNetEvent("md-drugs:client:makecrackone", function(data)
if not ItemCheck('bakingsoda') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failcrackone", data.data) return end
if not progressbar(Lang.Crack.cookcrack, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makecrackone", data.data)
end)
RegisterNetEvent("md-drugs:client:bagcrack", function(data) for k, v in pairs (GlobalState.MDDrugsLocs.makecrack) do
if not ItemCheck('empty_weed_bag') then return end ps.boxTarget('makeCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
if not progressbar(Lang.Crack.bagcrack, 4000, 'uncuff') then return end {
TriggerServerEvent("md-drugs:server:bagcrack", data.data) label = ps.lang('targets.crack.makecrack'),
end) icon = 'fa-solid fa-temperature-high',
action = function()
if not ps.hasItem('bakingsoda') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failcrackone", k) return end
if not ps.progressbar(ps.lang('Crack.makecrack'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makecrack", k)
end,
canInteract = function()
if not handleGang(v.gang) then return false end
return true
end
}
})
end
for k, v in pairs (GlobalState.MDDrugsLocs.bagcrack) do
ps.boxTarget('bagCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{
label = ps.lang('targets.crack.bagcrack'),
icon = 'fa-solid fa-weight-scale',
action = function()
if not ps.hasItem('empty_weed_bag') then return end
if not ps.progressbar(ps.lang('Crack.bagcrack'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:bagcrack", k)
end,
canInteract = function()
if not handleGang(v.gang) then return false end
return true
end
}
})
end
+2 -2
View File
@@ -8,7 +8,7 @@ RegisterNetEvent('md-drugs:client:opendealermenu', function()
end) end)
local function SpawnDealer() local function SpawnDealer()
local getDealers = lib.callback.await('md-drugs:server:getDealers', false) local getDealers = ps.callback('md-drugs:server:getDealers')
for k,v in pairs(getDealers) do for k,v in pairs(getDealers) do
local Ped = "g_m_y_famdnf_01" local Ped = "g_m_y_famdnf_01"
lib.requestModel(Ped, Config.RequestModelTime) lib.requestModel(Ped, Config.RequestModelTime)
@@ -18,7 +18,7 @@ local function SpawnDealer()
AddMultiModel(dealer[k], { AddMultiModel(dealer[k], {
{ icon = 'fas fa-user-secret', label = string.format(Lang.targets.Delivery.Deliver, v.name), { icon = 'fas fa-user-secret', label = string.format(Lang.targets.Delivery.Deliver, v.name),
action = function() action = function()
local bool, item, amount, coords = lib.callback.await('md-drugs:server:GetDeliveryItem', false, k) local bool, item, amount, coords = ps.callback('md-drugs:server:GetDeliveryItem', false, k)
if bool then if bool then
Email(Lang.Delivery.emailn, Lang.Delivery.emailsub, string.format(Lang.Delivery.emailcon, amount, GetLabel(item))) Email(Lang.Delivery.emailn, Lang.Delivery.emailsub, string.format(Lang.Delivery.emailcon, amount, GetLabel(item)))
TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords}) TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords})
+5 -159
View File
@@ -228,7 +228,7 @@ function GetLabel(label)
end end
function GetRep() function GetRep()
local rep = lib.callback.await('md-drugs:server:GetRep', false) local rep = ps.callback('md-drugs:server:GetRep')
return rep return rep
end end
@@ -239,7 +239,7 @@ end
function makeMenu(name, rep) function makeMenu(name, rep)
local menu = {} local menu = {}
local data = lib.callback.await('md-drugs:server:menu', false, name) local data = ps.callback('md-drugs:server:menu', name)
for k, v in pairs (data.table) do for k, v in pairs (data.table) do
local allow = false local allow = false
if rep == nil then if rep == nil then
@@ -374,7 +374,7 @@ end
function GetCops(number) function GetCops(number)
if number == 0 then return true end if number == 0 then return true end
local amount = lib.callback.await('md-drugs:server:GetCoppers', false) local amount = ps.callback('md-drugs:server:GetCoppers')
if amount >= number then return true else Notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') end if amount >= number then return true else Notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') end
end end
@@ -396,160 +396,6 @@ function tele(coords)
end end
function AddBoxZoneSingle(name, loc, data)
if Config.Target == 'qb' then
exports['qb-target']:AddBoxZone(name, loc, 1.5, 1.75, {name = name, minZ = loc.z-1,maxZ = loc.z +1},
{ options = {
{
type = data.type or nil,
event = data.event or nil,
action = data.action or nil,
icon = data.icon or "fa-solid fa-eye",
label = data.label,
data = data.data,
canInteract = data.canInteract,
}
},
distance = 2.0
})
elseif Config.Target == 'ox' then
exports.ox_target:addBoxZone({coords = loc, size = vec3(1,1,1), options = {
{
type = data.type or nil,
event = data.event or nil,
onSelect = data.action or nil,
distance = 2.5,
icon = data.icon or "fa-solid fa-eye",
label = data.label,
data = data.data,
canInteract = data.canInteract,
}
}, })
elseif Config.Target == 'interact' then
exports.interact:AddInteraction({
coords = vector3(loc.x, loc.y, loc.z),
distance = 2.5,
interactDst = 2,
id = name,
options = {
{
type = data.type or nil,
event = data.event or nil,
onSelect = data.action or nil,
distance = 2.5,
label = data.label,
data = data.data,
canInteract = data.canInteract,
},
}
})
end
end
function AddBoxZoneMulti(name, table, data)
for k, v in pairs (table) do
if v.gang == nil or v.gang == '' or v.gang == "" then v.gang = 1 end
if Config.Target == 'qb' then
exports['qb-target']:AddBoxZone(name .. k, v.loc, 1.5, 1.75, {name = name..k, minZ = v.loc.z-1.50,maxZ = v.loc.z +1.5},
{ options = {
{
type = data.type or nil,
event = data.event or nil,
action = data.action or nil,
icon = data.icon or "fa-solid fa-eye",
label = data.label,
data = k,
canInteract = data.canInteract or function()
if QBCore.Functions.GetPlayerData().gang.name == v.gang or v.gang == 1 then return true end end
}
},
distance = 2.5
})
elseif Config.Target == 'ox' then
exports.ox_target:addBoxZone({coords = v.loc, size = vec3(1,1,1), options = {
{
type = data.type or nil,
event = data.event or nil,
onSelect = data.action or nil,
icon = data.icon or "fa-solid fa-eye",
label = data.label,
data = k,
distance = 2.5,
canInteract = data.canInteract or function()
if QBCore.Functions.GetPlayerData().gang.name == v.gang or v.gang == 1 then return true end end
}
}, })
elseif Config.Target == 'interact' then
exports.interact:AddInteraction({
coords = vector3(v.loc.x, v.loc.y, v.loc.z),
distance = 2.5,
interactDst = 2,
id = name,
options = {
{
type = data.type or nil,
event = data.event or nil,
action = data.action or nil,
distance = 2.5,
label = data.label or "fa-solid fa-eye",
data = k,
canInteract = data.canInteract or function()
if QBCore.Functions.GetPlayerData().gang.name == v.gang or v.gang == 1 then return true end end
},
}
})
end
end
end
function AddBoxZoneMultiOptions(name, loc, data)
local options = {}
for k, v in pairs (data) do
table.insert(options, {
icon = v.icon or "fa-solid fa-eye", label = v.label, event = v.event or nil, action = v.action or nil,
onSelect = v.action,data = v.data,canInteract = v.canInteract or nil, distance = 2.0,
})
end
if Config.Target == 'qb' then
exports['qb-target']:AddBoxZone(name , loc, 1.5, 1.75, {name = name, minZ = loc.z-1.50,maxZ = loc.z +1.5},
{ options = options, distance = 2.5})
elseif Config.Target == 'ox' then
exports.ox_target:addBoxZone({coords = loc, size = vec3(1,1,1), options = options })
elseif Config.Target == 'interact' then
exports.interact:AddInteraction({coords = vector3(loc.x, loc.y, loc.z),distance = 2.5,interactDst = 2,id = name,options = options})
end
end
function AddSingleModel(model, data, num)
if Config.Target == 'qb' then
exports['qb-target']:AddTargetEntity(model, {options = {
{icon = data.icon or "fa-solid fa-eye", label = data.label, event = data.event or nil, action = data.action or nil, data = num }
}, distance = 2.5})
elseif Config.Target == 'ox' then
exports.ox_target:addLocalEntity(model, {icon = data.icon, label = data.label, event = data.event or nil, onSelect = data.action or nil, data = num, distance = 2.5 })
elseif Config.Target == 'interact' then
exports.interact:AddLocalEntityInteraction({entity = model,offset = vec3(0.0, 0.0, 1.0),id = 'mddrugs'..model,distance = 2.5,interactDst = 2.5, options = {label = data.label, event = data.event or nil, action = data.action or nil, data = num, distance = 2.5 }})
end
end
function AddMultiModel(model, data, num)
local options = {}
for k, v in pairs (data) do
table.insert(options, {
icon = v.icon or "fa-solid fa-eye", label = v.label, event = v.event or nil, action = v.action or nil,
onSelect = v.action,data = v.data,canInteract = v.canInteract or nil, distance = 2.0,
})
end
if Config.Target == 'qb' then
exports['qb-target']:AddTargetEntity(model, {options = options, distance = 2.5})
elseif Config.Target == 'ox' then
exports.ox_target:addLocalEntity(model, options)
elseif Config.Target == 'interact' then
local loc = GetEntityCoords(model)
exports.interact:AddLocalEntityInteraction({entity = model,offset = vec3(0.0, 0.0, 1.0),id = 'mddrugss'..model,distance = 2.5,interactDst = 2.5, options = data})
end
end
local created = false local created = false
local heading = 180.0 local heading = 180.0
@@ -654,14 +500,14 @@ CreateThread(function()
TriggerEvent('weed:init') TriggerEvent('weed:init')
end) end)
lib.callback.register('md-drugs:client:uncuff', function(data) ps.registerCallback('md-drugs:client:uncuff', function(data)
if not progressbar(data, 4000, 'uncuff') then return end if not progressbar(data, 4000, 'uncuff') then return end
return true return true
end) end)
RegisterCommand('DrugRep', function() RegisterCommand('DrugRep', function()
if not Config.TierSystem then return end if not Config.TierSystem then return end
local rep = lib.callback.await('md-drugs:server:GetRep', false) local rep = ps.callback('md-drugs:server:GetRep', false)
lib.registerContext({ lib.registerContext({
id = 'DrugRep', id = 'DrugRep',
title = 'Drug Reputation', title = 'Drug Reputation',
+2 -2
View File
@@ -71,7 +71,7 @@ RegisterNetEvent("md-drugs:client:buyheroinlabkit", function()
TriggerServerEvent("md-drugs:server:getheroinlabkit") TriggerServerEvent("md-drugs:server:getheroinlabkit")
end) end)
lib.callback.register("md-drugs:client:setheroinlabkit", function() ps.registerCallback("md-drugs:client:setheroinlabkit", function()
if herointable then if herointable then
Notify(Lang.Heroin.tableout, 'error') Notify(Lang.Heroin.tableout, 'error')
return false return false
@@ -103,7 +103,7 @@ end)
RegisterNetEvent("md-drugs:client:cleanheroinlabkit", function(data) RegisterNetEvent("md-drugs:client:cleanheroinlabkit", function(data)
if not ItemCheck('cleaningkit') then return end if not ItemCheck('cleaningkit') then return end
if not progressbar(Lang.Heroin.clean, 4000, 'clean') then return end if not progressbar(Lang.Heroin.clean, 4000, 'clean') then return end
local done = lib.callback.await('removeCleaningkit', false) local done = ps.callback('removeCleaningkit', false)
if done then dirty = false end if done then dirty = false end
end) end)
+1 -1
View File
@@ -6,7 +6,7 @@ end)
RegisterNetEvent('md-drugs:client:leancraft', function() RegisterNetEvent('md-drugs:client:leancraft', function()
local store = {} local store = {}
local label = {} local label = {}
local items = lib.callback.await('md-drugs:server:GetRecipe', false,'lean', 'cups') local items = ps.callback('md-drugs:server:GetRecipe', false,'lean', 'cups')
for k, v in pairs (items) do for k, v in pairs (items) do
label = {} label = {}
local item = '' local item = ''
+148 -70
View File
@@ -4,16 +4,85 @@ local function createLabKit(coord, head)
local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false) local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false)
SetEntityHeading(labkit, head) SetEntityHeading(labkit, head)
PlaceObjectOnGroundProperly(labkit) PlaceObjectOnGroundProperly(labkit)
FreezeEntityPosition(labkit, true)
tableout = true
local options = { local options = {
{ event = "md-drugs:client:heatliquid", icon = "fa-solid fa-temperature-high", label = Lang.targets.lsd.heat, data = labkit, canInteract = function() if not dirtylsd then return true end end }, {
{ event = "md-drugs:client:refinequalityacid", icon = "fa-solid fa-temperature-high", label = Lang.targets.lsd.refine, data = labkit,canInteract = function() if not dirtylsd then return true end end }, icon = "fa-solid fa-temperature-high",
{ event = "md-drugs:client:maketabpaper", icon = "fa-regular fa-note-sticky", label = Lang.targets.lsd.dab, data = labkit, canInteract = function() if not dirtylsd then return true end end }, label = Lang.targets.lsd.heat,
{ event = "md-drugs:client:getlabkitback", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.back, data = labkit, canInteract = function() if not dirtylsd then return true end end },
{icon = "fa-solid fa-hand-sparkles", label = Lang.targets.lsd.clean, data = labkit,
action = function() action = function()
if not ItemCheck('cleaningkit') then return end local dict = "scr_ie_svm_technical2"
if not progressbar(Lang.lsd.clean, 4000, 'clean') then return end if not ps.hasItems({
local check = lib.callback.await('md-drugs:server:removecleaningkit') {name = 'lysergic_acid', amount = 1},
{name = 'diethylamide', amount = 1}
}) then
Notify(Lang.lsd.need, 'error')
return
end
if not minigame() then
dirtylsd = true
loadParticle(dict)
local exitPtfx = StartParticleFxLoopedOnEntity("scr_dst_cocaine", labkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
SetParticleFxLoopedAlpha(exitPtfx, 3.0)
return
end
if not progressbar(Lang.lsd.heat, 7000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:heatliquid")
end,
canInteract = function()
if not dirtylsd then return true end
end
},
{
icon = "fa-solid fa-temperature-high",
label = Lang.targets.lsd.refine,
action = function()
if not ps.hasItem('lsd_one_vial') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failrefinequality") return end
if not ps.progressbar(Lang.lsd.refine, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:refinequalityacid")
end,
canInteract = function()
if not dirtylsd then return true end
end
},
{
icon = "fa-regular fa-note-sticky",
label = Lang.targets.lsd.dab,
action = function()
if not ps.hasItem('tab_paper') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failtabs") return end
if not ps.progressbar(Lang.lsd.dip, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:maketabpaper")
end,
canInteract = function()
if not dirtylsd then return true end
end
},
{
event = "md-drugs:client:getlabkitback",
icon = "fas fa-box-circle-check",
label = Lang.targets.lsd.back,
action = function()
if not progressbar(Lang.lsd.tablepack, 4000, 'uncuff') then return end
DeleteObject(labkit)
TriggerServerEvent('md-drugs:server:getlabkitback')
tableout = false
end,
canInteract = function()
if not dirtylsd then return true end
end
},
{
icon = "fa-solid fa-hand-sparkles",
label = Lang.targets.lsd.clean,
action = function()
if not ps.hasItem('cleaningkit') then
Notify(Lang.lsd.needclean, 'error')
return
end
if not ps.progressbar(Lang.lsd.clean, 4000, 'clean') then return end
local check = ps.callback('md-drugs:server:removecleaningkit')
if check then if check then
dirtylsd = false dirtylsd = false
end end
@@ -21,24 +90,83 @@ local function createLabKit(coord, head)
canInteract = function() if dirtylsd then return true end end canInteract = function() if dirtylsd then return true end end
} }
} }
AddMultiModel(labkit, options, labkit) ps.targetEntity(labkit, options)
end end
RegisterNetEvent("md-drugs:client:getlysergic", function(data) for k, v in pairs (GlobalState.MDDrugsLocs.lysergicacid) do
if not minigame() then return end ps.boxTarget('lysergicacid'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
if not progressbar(Lang.lsd.steallys, 4000, 'uncuff') then return end {
TriggerServerEvent("md-drugs:server:getlysergic",data.data) label = Lang.targets.lsd.lys,
end) icon = 'fa-solid fa-temperature-high',
action = function()
if not ps.hasItem('empty_weed_bag') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:faillysergic") return end
if not ps.progressbar(Lang.lsd.steallys, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:getlysergic", k)
end,
canInteract = function()
if not handleGang(v.gang) then return false end
return true
end
}
})
end
for k, v in pairs (GlobalState.MDDrugsLocs.diethylamide) do
ps.boxTarget('diethylamide'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{
label = Lang.targets.lsd.die,
icon = 'fa-solid fa-temperature-high',
action = function()
if not ps.hasItem('empty_weed_bag') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:faildiethylamide") return end
if not ps.progressbar(Lang.lsd.stealdie, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:getdiethylamide", k)
end,
canInteract = function()
if not handleGang(v.gang) then return false end
return true
end
}
})
end
RegisterNetEvent("md-drugs:client:getdiethylamide", function(data) for k,v in pairs (GlobalState.MDDrugsLocs.gettabs) do
if not minigame() then return end ps.boxTarget('gettabs'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
if not progressbar(Lang.lsd.stealdie, 4000, 'uncuff') then return end {
TriggerServerEvent('md-drugs:server:getdiethylamide', data.data) label = Lang.targets.lsd.buyt,
end) icon = 'fa-solid fa-hand-holding-dollar',
action = function()
if not ps.hasItem('lsdlabkit') then ps.notify(Lang.lsd.havlabkit, 'error') return end
TriggerEvent("md-drugs:client:buytabs", k)
end,
canInteract = function()
if not handleGang(v.gang) then return false end
return true
end
}
})
end
for k, v in pairs (GlobalState.MDDrugsLocs.buykit) do
ps.boxTarget('buykit'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{
label = Lang.targets.lsd.buy,
icon = 'fa-solid fa-hand-holding-dollar',
action = function()
if ps.hasItem('lsdlabkit') then ps.notify(Lang.lsd.havlabkit, 'error') return end
if not ps.progressbar(Lang.lsd.buykit, 4000, 'uncuff') then return end
TriggerEvent("md-drugs:client:buylabkit")
end,
canInteract = function()
if not handleGang(v.gang) then return false end
return true
end
}
})
end
lib.callback.register("md-drugs:client:setlsdlabkit", function() ps.registerCallback("md-drugs:client:setlsdlabkit", function()
if tableout then if tableout then
Notify(Lang.lsd.tableout, 'error') Notify(Lang.lsd.tableout, 'error')
return false return false
@@ -51,53 +179,3 @@ lib.callback.register("md-drugs:client:setlsdlabkit", function()
return true, loc return true, loc
end end
end) end)
RegisterNetEvent("md-drugs:client:getlabkitback", function(data)
if not progressbar(Lang.lsd.tablepack, 4000, 'uncuff') then return end
DeleteObject(data.data)
TriggerServerEvent('md-drugs:server:getlabkitback')
tableout = false
end)
RegisterNetEvent("md-drugs:client:heatliquid", function(data)
local PedCoords, head = GetEntityCoords(data.data), GetEntityHeading(data.data)
local dict = "scr_ie_svm_technical2"
if not ItemCheck('lysergic_acid') then return end
if not ItemCheck('diethylamide') then return end
if not minigame() then
dirtylsd = true
loadParticle(dict)
local exitPtfx = StartParticleFxLoopedOnEntity("scr_dst_cocaine", data.data, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
SetParticleFxLoopedAlpha(exitPtfx, 3.0)
Wait(100)
AddMultiModel(dirtylabkit, {{event = "md-drugs:client:cleanlabkit", icon = "fa-solid fa-hand-sparkles", label = Lang.targets.lsd.clean, data = dirtylabkit}}, nil )
return end
if not progressbar(Lang.lsd.heat, 7000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:heatliquid")
end)
RegisterNetEvent("md-drugs:client:refinequalityacid", function()
if not ItemCheck('lsd_one_vial') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failrefinequality") return end
if not progressbar(Lang.lsd.refine, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:refinequalityacid")
end)
RegisterNetEvent("md-drugs:client:maketabpaper", function()
if not ItemCheck('tab_paper') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failtabs") return end
if not progressbar(Lang.lsd.dip, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:maketabpaper")
end)
RegisterNetEvent("md-drugs:client:buytabs", function(data)
if not progressbar(Lang.lsd.buypaper, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:gettabpaper", data.data)
end)
RegisterNetEvent("md-drugs:client:buylabkit", function()
if hasItem('lsdlabkit') then Notify(Lang.lsd.hav, 'error') return end
if not progressbar(Lang.lsd.buykit, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:getlabkit")
end)
+1 -1
View File
@@ -82,7 +82,7 @@ CreateThread(function()
end) end)
CreateThread(function() CreateThread(function()
local config = lib.callback.await('md-drugs:server:getLocs', false) local config = ps.callback('md-drugs:server:getLocs', false)
AddBoxZoneSingle("methTeleOut",config.singleSpot.MethTeleIn, {name = 'teleout', icon = "fa-solid fa-door-open", label = Lang.targets.meth.enter, action = function() SetEntityCoords(PlayerPedId(), config.singleSpot.MethTeleOut) end} ) AddBoxZoneSingle("methTeleOut",config.singleSpot.MethTeleIn, {name = 'teleout', icon = "fa-solid fa-door-open", label = Lang.targets.meth.enter, action = function() SetEntityCoords(PlayerPedId(), config.singleSpot.MethTeleOut) end} )
AddBoxZoneSingle("methtelein",config.singleSpot.MethTeleOut, {name = 'teleout', icon = "fa-solid fa-door-closed", label = Lang.targets.meth.exit, action = function() SetEntityCoords(PlayerPedId(), config.singleSpot.MethTeleIn) end} ) AddBoxZoneSingle("methtelein",config.singleSpot.MethTeleOut, {name = 'teleout', icon = "fa-solid fa-door-closed", label = Lang.targets.meth.exit, action = function() SetEntityCoords(PlayerPedId(), config.singleSpot.MethTeleIn) end} )
local options = { local options = {
+3 -3
View File
@@ -2,9 +2,9 @@ local carryPackage = nil
RegisterNetEvent("md-drugs:client:GetOxyCar", function() RegisterNetEvent("md-drugs:client:GetOxyCar", function()
lib.requestModel("burrito3", Config.RequestModelTime) lib.requestModel("burrito3", Config.RequestModelTime)
local paid = lib.callback.await('md-drugs:server:payfortruck', false) local paid = ps.callback('md-drugs:server:payfortruck', false)
if not paid then return end if not paid then return end
local loca = lib.callback.await('md-drugs:server:getLocs', false) local loca = ps.callback('md-drugs:server:getLocs', false)
local loc = loca.singleSpot.truckspawn local loc = loca.singleSpot.truckspawn
local oxycar = CreateVehicle("burrito3",loc.x, loc.y,loc.z, loc.w, true, false) local oxycar = CreateVehicle("burrito3",loc.x, loc.y,loc.z, loc.w, true, false)
exports[Config.Fuel]:SetFuel(oxycar, 100.0) exports[Config.Fuel]:SetFuel(oxycar, 100.0)
@@ -15,7 +15,7 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function()
end) end)
RegisterNetEvent("md-drugs:client:getoxylocationroute", function() RegisterNetEvent("md-drugs:client:getoxylocationroute", function()
local config = lib.callback.await('md-drugs:server:getLocs', false) local config = ps.callback('md-drugs:server:getLocs', false)
local loc = config.oxylocations[math.random(#config.oxylocations)] local loc = config.oxylocations[math.random(#config.oxylocations)]
if loc ~= nil then if loc ~= nil then
SetNewWaypoint(loc.x, loc.y) SetNewWaypoint(loc.x, loc.y)
+2 -2
View File
@@ -1,7 +1,7 @@
CreateThread(function() CreateThread(function()
local config = lib.callback.await('md-drugs:server:getLocs', false) local config = ps.callback('md-drugs:server:getLocs', false)
local num = lib.callback.await('md-drugs:server:GetMerchant', false) local num = ps.callback('md-drugs:server:GetMerchant', false)
local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01', "prop_cooker_03"} local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01', "prop_cooker_03"}
for k, v in pairs (model) do for k, v in pairs (model) do
lib.requestModel(v, Config.RequestModelTime) lib.requestModel(v, Config.RequestModelTime)
+2 -2
View File
@@ -1,5 +1,5 @@
lib.callback.register("md-drugs:client:prescriptionpad", function(data, op) ps.registerCallback("md-drugs:client:prescriptionpad", function(data, op)
if getJobType() ~= 'ems' then return end if getJobType() ~= 'ems' then return end
local input = lib.inputDialog('Who To Give A Prescription To?',{ local input = lib.inputDialog('Who To Give A Prescription To?',{
{type = 'select', label = 'Player Name', options = data}, {type = 'select', label = 'Player Name', options = data},
@@ -14,7 +14,7 @@ RegisterNetEvent("md-drugs:client:fillprescription", function(data)
TriggerServerEvent("md-drugs:server:fillprescription", data.data) TriggerServerEvent("md-drugs:server:fillprescription", data.data)
end) end)
lib.callback.register("md-drugs:client:unbottle", function() ps.registerCallback("md-drugs:client:unbottle", function()
if not progressbar(Lang.Pharma.open, 4000, 'uncuff') then return end if not progressbar(Lang.Pharma.open, 4000, 'uncuff') then return end
return true return true
end) end)
-24
View File
@@ -1,24 +0,0 @@
CreateThread(function()
local config = lib.callback.await('md-drugs:server:getLocs', false)
if not config then print('Yo Dawg You Broke Your Locations.lua') return end
AddBoxZoneSingle('telecokein', config.singleSpot.CokeTeleIn, {action = function()tele(config.singleSpot.CokeTeleOut)end, icon = 'fa-solid fa-door-open', label = Lang.targets.coke.enter}) -- coke
AddBoxZoneSingle('telecokeout', config.singleSpot.CokeTeleOut, {action = function()tele(config.singleSpot.CokeTeleIn) end, icon = "fa-solid fa-door-closed", label = Lang.targets.coke.exit}) -- coke
AddBoxZoneMulti('makepowder', config.MakePowder, {event = "md-drugs:client:makepowder", icon = "fa-solid fa-scissors", label = Lang.targets.coke.chop}) -- coke
AddBoxZoneMulti('steallysergic', config.lysergicacid, {event = "md-drugs:client:getlysergic", icon = "fa-solid fa-prescription-bottle", label = Lang.targets.lsd.lys}) -- lsd
AddBoxZoneMulti('stealdiethylamide', config.diethylamide, {event = "md-drugs:client:getdiethylamide", icon = "fa-solid fa-prescription-bottle", label = Lang.targets.lsd.die}) -- lsd
AddBoxZoneMulti('gettabs', config.gettabs, {event = "md-drugs:client:buytabs", icon = "fa-solid fa-eye-dropper", label = Lang.targets.lsd.buyt}) -- lsd
AddBoxZoneMulti('dryheroin', config.dryplant, {event = "md-drugs:client:dryplant", icon = "fa-solid fa-temperature-full", label = Lang.targets.heroin.dry}) -- heroin
AddBoxZoneMulti('cutheroin', config.cutheroinone, {event = "md-drugs:client:cutheroin", icon = "fa-solid fa-flask", label = Lang.targets.heroin.cut}) -- heroin
AddBoxZoneMulti('fillneedle', config.fillneedle, {event = "md-drugs:client:fillneedle", icon = "fa-solid fa-syringe", label = Lang.targets.heroin.fill}) -- heroin
AddBoxZoneMulti('makecrack', config.makecrack, {event = "md-drugs:client:makecrackone", icon = "fa-solid fa-temperature-high", label = Lang.targets.crack.cook}) -- crack
AddBoxZoneMulti('bagcrack', config.bagcrack, {event = "md-drugs:client:bagcrack", icon = "fa-solid fa-weight-scale", label = Lang.targets.crack.bag}) -- crack
AddBoxZoneMulti('fillprescription', config.FillPrescription, {event = "md-drugs:client:fillprescription", icon = "fa-solid fa-prescription", label = Lang.targets.pha.fill}) -- pharma
AddBoxZoneSingle('payfortruck', config.singleSpot.Payfortruck, {event = "md-drugs:client:GetOxyCar", icon = "fa-solid fa-truck-moving", label = Lang.targets.oxy.pay}) -- oxy runs
AddBoxZoneSingle('drymescaline', config.singleSpot.DryOut, {event = "md-drugs:client:drymescaline", icon = "fa-solid fa-temperature-full", label = Lang.targets.mescaline.dry}) -- mescaline
AddBoxZoneMulti('stealisosafrole', config.isosafrole, {event = "md-drugs:client:stealisosafrole", icon = "fa-solid fa-vial", label = Lang.targets.xtc.iso}) -- xtc
AddBoxZoneMulti('stealmdp2p', config.mdp2p, {event = "md-drugs:client:stealmdp2p", icon = "fa-solid fa-vial", label = Lang.targets.xtc.mdp}) -- xtc
AddBoxZoneMulti('rawxtcloc', config.rawxtcloc, {event = "md-drugs:client:makingrawxtc", icon = "fa-solid fa-tablets", label = Lang.targets.xtc.raw}) -- xtc
AddBoxZoneSingle('buypress', config.singleSpot.buypress, {event = "md-drugs:client:buypress", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.xtc.press}) -- xtc
AddBoxZoneMulti('stamp', config.stamp, {event = "md-drugs:client:stampwhite", icon = "fa-solid fa-tablets", label = Lang.targets.xtc.stamp}) -- xtc
end)
+2 -2
View File
@@ -54,7 +54,7 @@ AddEventHandler('onResourceStop', function(resourceName)
end) end)
CreateThread(function() CreateThread(function()
local config = lib.callback.await('md-drugs:server:getLocs', false) local config = ps.callback('md-drugs:server:getLocs', false)
AddBoxZoneMulti('weeddry', config.WeedDry, { AddBoxZoneMulti('weeddry', config.WeedDry, {
name = 'dryweed', name = 'dryweed',
icon = "fas fa-sign-in-alt", icon = "fas fa-sign-in-alt",
@@ -147,7 +147,7 @@ end)
local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName) local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName)
local options = {} local options = {}
local items = lib.callback.await('md-drugs:server:GetRecipe', false,'weed',tableName) local items = ps.callback('md-drugs:server:GetRecipe', false,'weed',tableName)
for k, v in pairs(items) do for k, v in pairs(items) do
local label = {} local label = {}
local item = '' local item = ''
+1 -1
View File
@@ -22,7 +22,7 @@ RegisterNetEvent("md-drugs:client:setpress", function(type)
end end
end) end)
lib.callback.register('md-drugs:client:setpress', function(type) ps.registerCallback('md-drugs:client:setpress', function(type)
if xtcpress then if xtcpress then
Notify(Lang.xtc.out, 'error') Notify(Lang.xtc.out, 'error')
return false return false
+27
View File
@@ -0,0 +1,27 @@
function loadFile(filePath)
local resourceName = 'md-drugs'
local fullScript = LoadResourceFile(resourceName, filePath)
if not fullScript then
ps.error("Error: Failed to load module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
return false
end
local chunk, err = load(fullScript, filePath, "t")
if not chunk then
ps.error("Error loading Lua chunk from '" .. filePath .. "': " .. tostring(err))
return false
end
local success, execErr = pcall(chunk)
if not success then
ps.error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr))
return false
end
ps.success("Successfully loaded module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
return true
end
for scriptName, toggle in pairs(Config.Drugs) do
if not toggle then goto continue end
loadFile('client/' .. scriptName .. '.lua')
::continue::
end
+9 -5
View File
@@ -5,26 +5,30 @@ fx_version "cerulean"
game "gta5" game "gta5"
version '3.9.0' version '3.9.0'
client_scripts { client_scripts {
'client/**.lua', 'client/functions.lua',
'client/animationsandfunctions.lua',
'clientRun.lua',
} }
server_scripts { server_scripts {
'server/functions.lua', 'server/functions.lua',
'server/**.lua', 'serverRun.lua',
'@oxmysql/lib/MySQL.lua', '@oxmysql/lib/MySQL.lua',
} }
shared_scripts { shared_scripts {
'shared/config.lua',
'@ox_lib/init.lua',
'shared/**.lua', 'shared/**.lua',
'@ox_lib/init.lua',
} }
lua54 'yes' lua54 'yes'
files { files {
'stream/mushroom.ytyp', 'stream/mushroom.ytyp',
'stream/mushroom.ydr' 'stream/mushroom.ydr',
'client/**.lua',
'server/**.lua',
'locales/**.lua'
} }
data_file 'DLC_ITYP_REQUEST' 'stream/mushroom.ytyp' data_file 'DLC_ITYP_REQUEST' 'stream/mushroom.ytyp'
+2
View File
@@ -294,3 +294,5 @@ Lang.Wholesale = {
na = 'No One Answered, Try Again Later', na = 'No One Answered, Try Again Later',
} }
return Lang
+4 -6
View File
@@ -50,9 +50,8 @@ end)
RegisterServerEvent('md-drugs:server:makepowder', function(num) RegisterServerEvent('md-drugs:server:makepowder', function(num)
local src = source local src = source
ps.debug(#(GetEntityCoords(GetPlayerPed(src)) - GlobalState.MDDrugsLocs.MakePowder[num].loc))
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.MakePowder[num].loc, 3.5) then if not ps.checkDistance(src, GlobalState.MDDrugsLocs.MakePowder[num].loc, 3.5) then
Notifys(src, 'You are not in the correct location', 'error') ps.notify(src, 'You are not in the correct location', 'error')
return return
end end
local tier = 'tier1' local tier = 'tier1'
@@ -71,7 +70,7 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function(num)
local src = source local src = source
local tier = 'tier1' local tier = 'tier1'
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.CuttingCoke[num].loc, 2.5) then if not ps.checkDistance(src, GlobalState.MDDrugsLocs.CuttingCoke[num].loc, 2.5) then
Notifys(src, 'You are not in the correct location', 'error') ps.notify(src, 'You are not in the correct location', 'error')
return return
end end
if Config.TierSystem then if Config.TierSystem then
@@ -94,7 +93,7 @@ RegisterServerEvent('md-drugs:server:bagcoke', function(num)
local src = source local src = source
local tier = 'tier1' local tier = 'tier1'
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.BaggingCoke[num].loc, 2.5) then if not ps.checkDistance(src, GlobalState.MDDrugsLocs.BaggingCoke[num].loc, 2.5) then
Notifys(src, 'You are not in the correct location', 'error') ps.notify(src, 'You are not in the correct location', 'error')
return return
end end
if Config.TierSystem then if Config.TierSystem then
@@ -120,10 +119,9 @@ local cokecut = {loosecokestagetwo = 2, loosecokestagethree = 3}
for k, v in pairs (cokecut) do for k, v in pairs (cokecut) do
ps.createUseable(k, function(source, item) ps.createUseable(k, function(source, item)
local src = source local src = source
local Player = getPlayer(src)
if not ps.hasItem(src, 'bakingsoda') then ps.notify(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 ps.hasItem(src,item.name) then if ps.hasItem(src,item.name) then
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting It Further') local check = ps.callback('md-drugs:client:uncuff', src, 'Cutting It Further')
if not check then return end if not check then return end
if ps.removeItem(src, k, 1) and ps.removeItem(src, 'bakingsoda', 1) then if ps.removeItem(src, k, 1) and ps.removeItem(src, 'bakingsoda', 1) then
ps.addItem(src, 'loosecoke', v) ps.addItem(src, 'loosecoke', v)
+1 -1
View File
@@ -150,7 +150,7 @@ for k, v in pairs(Consume) do
local anim = v.anim or Consumables.defaultanim local anim = v.anim or Consumables.defaultanim
local progressbartext = v.progressbartext or Consumables.defaultprogresstext local progressbartext = v.progressbartext or Consumables.defaultprogresstext
local add = v.add or {hunger = 0} local add = v.add or {hunger = 0}
local done = lib.callback.await('md-drugs:client:consumedrugs', source, time, effect, anim, progressbartext, add, k) local done = ps.callback('md-drugs:client:consumedrugs', source, time, effect, anim, progressbartext, add, k)
if done then if done then
RemoveItem(source, k, 1) RemoveItem(source, k, 1)
end end
+2 -2
View File
@@ -121,7 +121,7 @@ local Drugs = {
["cupofdextro"] = {rep = 1,min = 18, max = 40}, ["cupofdextro"] = {rep = 1,min = 18, max = 40},
} }
lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, ped) ps.registerCallback('md-drugs:server:cornerselling:getAvailableDrugs', function(source, ped)
local Player = getPlayer(source) local Player = getPlayer(source)
local rep = getRep(source, 'cornerselling') local rep = getRep(source, 'cornerselling')
if not Player then return nil end if not Player then return nil end
@@ -144,7 +144,7 @@ lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', functio
end end
end) end)
lib.callback.register('md-drugs:server:hasDrugs', function(source) ps.registerCallback('md-drugs:server:hasDrugs', function(source)
local Player = getPlayer(source) local Player = getPlayer(source)
for k, v in pairs(Drugs) do for k, v in pairs(Drugs) do
local item = Player.Functions.GetItemByName(k) local item = Player.Functions.GetItemByName(k)
+48 -28
View File
@@ -1,62 +1,82 @@
local QBCore = exports['qb-core']:GetCoreObject()
RegisterServerEvent('md-drugs:server:makecrackone', function(num) RegisterServerEvent('md-drugs:server:makecrackone', function(num)
local src = source local src = source
local Player = getPlayer(src) local tier = 'tier1'
local count,type, tier = 0, 'cookcrack', 'tier1' if not ps.checkDistance(src, GlobalState.MDDrugsLocs.makecrack[num].loc, 2.0) then
if not checkLoc(src, 'makecrack', num) then return end ps.notify(src, 'You are not in the correct location', 'error')
return
end
if Config.TierSystem then if Config.TierSystem then
local crackTiers = { local crackTiers = {
{item = 'loosecoke', tier = 'tier1', log = ' Cut Crack'}, {item = 'loosecoke', tier = 'tier1'},
{item = 'loosecokestagetwo', tier = 'tier2', log = ' Cut Crack tier 2'}, {item = 'loosecokestagetwo', tier = 'tier2'},
{item = 'loosecokestagethree', tier = 'tier3', log = ' Cut Crack tier 3'} {item = 'loosecokestagethree', tier = 'tier3'}
} }
for _, v in ipairs(crackTiers) do for _, v in ipairs(crackTiers) 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
end end
if not GetRecipe(src, 'crack', type, tier) then return end if not GetRecipe(src, 'crack', 'cookcrack', tier) then return end
end) end)
RegisterServerEvent('md-drugs:server:bagcrack', function(num) RegisterServerEvent('md-drugs:server:bagcrack', function(num)
local src = source local src = source
local Player = getPlayer(src) local tier = 'tier1'
local count,type, tier = 0, 'bagcrack', 'tier1' if not ps.checkDistance(src, GlobalState.MDDrugsLocs.bagcrack[num].loc, 2.0) then
if not checkLoc(src, 'bagcrack', num) then return end ps.notify(src, 'You are not in the correct location', 'error')
return
end
if Config.TierSystem then if Config.TierSystem then
local crackTiers = { local crackTiers = {
{item = 'crackrock', tier = 'tier1', log = ' Bagged Crack'}, {item = 'crackrock', tier = 'tier1'},
{item = 'crackrockstagetwo', tier = 'tier2', log = ' Bagged Crack tier 2'}, {item = 'crackrockstagetwo', tier = 'tier2'},
{item = 'crackrockstagethree', tier = 'tier3', log = ' Bagged Crack tier 3'} {item = 'crackrockstagethree', tier = 'tier3'}
} }
for _, v in ipairs(crackTiers) do for _, v in ipairs(crackTiers) 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
end end
if not GetRecipe(src, 'crack', type, tier) then return end if not GetRecipe(src, 'crack', 'bagcrack', tier) then return end
end) end)
local cokecut = {crackrockstagetwo = 2, crackrockstagethree = 3} local cokecut = {crackrockstagetwo = 2, crackrockstagethree = 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) if ps.hasItem(src, item.name) then
if Player.Functions.GetItemByName(item.name) then if not ps.hasItem(src, 'bakingsoda', 1) then return end
if not Itemcheck(src, 'bakingsoda', 1) then return end local check = ps.callback('md-drugs:client:uncuff', src, 'Cutting Crack Rock Further')
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting Crack Rock 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, 'crackrock', v) ps.addItem(src, 'crackrock', v)
end end
end end
end) end)
end end
RegisterNetEvent("md-drugs:server:failcrackone", function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.makecrack[num].loc, 2.0) then
ps.notify(src, 'You are not in the correct location', 'error')
return
end
local items = {
loosecoke = 1,
loosecokestagetwo = 1,
loosecokestagethree = 1
}
for k,v in pairs(items) do
if ps.hasItem(src, k, v) then
ps.removeItem(src, k, v)
ps.notify(src, 'You failed to make crack and lost '..v..' '..k, 'error')
return
end
end
end)
+2 -2
View File
@@ -80,7 +80,7 @@ local dloc = {
{coords = vector4(223.98, 121.53, 102.76, 259.68)}, {coords = vector4(223.98, 121.53, 102.76, 259.68)},
{coords = vector4(102.19, -255.02, 50.05, 83.59)}, {coords = vector4(102.19, -255.02, 50.05, 83.59)},
} }
lib.callback.register('md-drugs:server:getDealers', function(data) ps.registerCallback('md-drugs:server:getDealers', function(data)
local check = MySQL.query.await('SELECT * FROM dealers', {}) local check = MySQL.query.await('SELECT * FROM dealers', {})
local loc = json.encode({x = 899.98, y = -2603.24, z = 6.11, h = 176.12 }) local loc = json.encode({x = 899.98, y = -2603.24, z = 6.11, h = 176.12 })
if not check[1] then if not check[1] then
@@ -99,7 +99,7 @@ local DeliveryItems = {
{ item = "coke_brick", minrep = 0, payout = {min = 10, max = 50}}, { item = "coke_brick", minrep = 0, payout = {min = 10, max = 50}},
} }
lib.callback.register('md-drugs:server:GetDeliveryItem', function(data) ps.registerCallback('md-drugs:server:GetDeliveryItem', function(data)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
local itemnum = math.random(1, #DeliveryItems) local itemnum = math.random(1, #DeliveryItems)
+2 -2
View File
@@ -323,7 +323,7 @@ function getCops()
return amount return amount
end end
lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args) ps.registerCallback('md-drugs:server:GetCoppers', function(source, cb, args)
local amount = 0 local amount = 0
local players = QBCore.Functions.GetQBPlayers() local players = QBCore.Functions.GetQBPlayers()
for k, v in pairs(players) do for k, v in pairs(players) do
@@ -334,7 +334,7 @@ lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
return amount return amount
end) end)
lib.callback.register('md-drugs:server:GetRep', function(source, cb, args) ps.registerCallback('md-drugs:server:GetRep', function(source, cb, args)
local src = source local src = source
local rep = GetAllRep(source) local rep = GetAllRep(source)
return rep return rep
+2 -2
View File
@@ -37,7 +37,7 @@ function heroinCooldown(loc)
end) end)
end end
lib.callback.register('removeCleaningkit', function(source) ps.registerCallback('removeCleaningkit', function(source)
local Player = getPlayer(source) local Player = getPlayer(source)
for k, v in pairs(heroinLabKits) do for k, v in pairs(heroinLabKits) do
if v.ownerid == Player.PlayerData.citizenid then if v.ownerid == Player.PlayerData.citizenid then
@@ -141,7 +141,7 @@ CUI('heroinlabkit', function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
if not Itemcheck(source, 'heroinlabkit', 1) then return end if not Itemcheck(source, 'heroinlabkit', 1) then return end
local placed, loc = lib.callback.await('md-drugs:client:setheroinlabkit', src) local placed, loc = ps.callback('md-drugs:client:setheroinlabkit', src)
if placed then if placed then
RemoveItem(src, 'heroinlabkit', 1) RemoveItem(src, 'heroinlabkit', 1)
table.insert(heroinLabKits, { table.insert(heroinLabKits, {
+2 -2
View File
@@ -134,11 +134,11 @@ function checkLoc(source, event, num)
end end
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)] local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
lib.callback.register('md-drugs:server:getLocs', function() ps.registerCallback('md-drugs:server:getLocs', function()
return Target return Target
end) end)
lib.callback.register('md-drugs:server:GetMerchant', function(source) ps.registerCallback('md-drugs:server:GetMerchant', function(source)
return loc return loc
end) end)
+23 -8
View File
@@ -1,29 +1,44 @@
local QBCore = exports['qb-core']:GetCoreObject()
local prices = { local prices = {
tabcost = 100, -- price per piece of tab paper event does 10 at a time tabcost = 100, -- price per piece of tab paper event does 10 at a time
lsdlabkitcost = 10000 -- price of the lsd lab kit lsdlabkitcost = 10000 -- price of the lsd lab kit
} }
local timedOut = {}
local function timeout(src, time)
timedOut[src] = true
CreateThread(function()
Wait(time)
timedOut[src] = nil
end)
end
local lsdTables = {} local lsdTables = {}
RegisterServerEvent('md-drugs:server:getlysergic', function(num) RegisterServerEvent('md-drugs:server:getlysergic', function(num)
local src = source local src = source
if not checkLoc(src, 'lysergicacid', num) then return end if timedOut[src] then return end
if AddItem(src,'lysergic_acid', 2) then if not ps.checkDistance(src, GlobalState.MDDrugsLocs.lysergicacid[num].loc, 2.0) then
Notifys(src, Lang.lsd.notinloc, "error")
return
end end
timeout(src, 3000)
ps.addItem(src, 'lysergic_acid', 2)
end) end)
RegisterServerEvent('md-drugs:server:getdiethylamide', function(num) RegisterServerEvent('md-drugs:server:getdiethylamide', function(num)
local src = source local src = source
if not checkLoc(src, 'diethylamide', num) then return end if not ps.checkDistance(src, GlobalState.MDDrugsLocs.diethylamide[num].loc, 2.0) then
if AddItem(src,'diethylamide', 2) then Notifys(src, Lang.lsd.notinloc, "error")
return
end end
if timedOut[src] then return end
timeout(src, 3000)
ps.addItem(src, 'diethylamide', 2)
end) end)
CUI('lsdlabkit', function(source, item) CUI('lsdlabkit', function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
local placed, loc = lib.callback.await('md-drugs:client:setlsdlabkit', src) local placed, loc = ps.callback('md-drugs:client:setlsdlabkit', src)
if placed then if placed then
if RemoveItem(src, 'lsdlabkit', 1) then if RemoveItem(src, 'lsdlabkit', 1) then
table.insert(lsdTables, { table.insert(lsdTables, {
@@ -46,7 +61,7 @@ local function hasLabKit(source)
end end
end end
lib.callback.register('md-drugs:server:removecleaningkit', function(source) ps.registerCallback('md-drugs:server:removecleaningkit', function(source)
local src = source local src = source
if not Itemcheck(src, 'cleaningkit', 1) then return end if not Itemcheck(src, 'cleaningkit', 1) then return end
if RemoveItem(src,"cleaningkit", 1) then if RemoveItem(src,"cleaningkit", 1) then
+1 -1
View File
@@ -4,7 +4,7 @@ local prices = {
hotchance = 30, hotchance = 30,
itemChance = 20, itemChance = 20,
} }
lib.callback.register('md-drugs:server:payfortruck', function() ps.registerCallback('md-drugs:server:payfortruck', function()
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then
+2 -2
View File
@@ -25,7 +25,7 @@ CUI('prescription_pad', function(source, item)
end end
end end
local options = { {label = 'Vicodin', value = 'vicodin_prescription'}, {label = 'Adderal', value = 'adderal_prescription'}, {label = 'Morphine', value = 'morphine_prescription'},{label = 'Xanax', value = 'xanax_prescription'}} local options = { {label = 'Vicodin', value = 'vicodin_prescription'}, {label = 'Adderal', value = 'adderal_prescription'}, {label = 'Morphine', value = 'morphine_prescription'},{label = 'Xanax', value = 'xanax_prescription'}}
local data = lib.callback.await('md-drugs:client:prescriptionpad', src, near, options) local data = ps.callback('md-drugs:client:prescriptionpad', src, near, options)
if type(data) == 'table' then if type(data) == 'table' then
local give = QBCore.Functions.GetPlayerByCitizenId(data.who) local give = QBCore.Functions.GetPlayerByCitizenId(data.who)
for i = 1, #options do for i = 1, #options do
@@ -42,7 +42,7 @@ for m, d in pairs (pharmabottle) do
CUI(d, function(source, item) CUI(d, function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
local check = lib.callback.await("md-drugs:client:unbottle", src) local check = ps.callback("md-drugs:client:unbottle", src)
if check then if check then
local get = { local get = {
['vicodinbottle'] = 'vicodin', ['vicodinbottle'] = 'vicodin',
+1 -1
View File
@@ -139,7 +139,7 @@ function GetRecipe(source, type, method, tier)
ps.craftItem(source,recipe[type][method][tier]) ps.craftItem(source,recipe[type][method][tier])
end end
lib.callback.register('md-drugs:server:GetRecipe', function(source, type, cat) ps.registerCallback('md-drugs:server:GetRecipe', function(source, type, cat)
if not source then return false end if not source then return false end
return recipe[type][cat] return recipe[type][cat]
end) end)
+1 -1
View File
@@ -53,7 +53,7 @@ local stores = {
} }
} }
lib.callback.register('md-drugs:server:menu', function(source, data) ps.registerCallback('md-drugs:server:menu', function(source, data)
local src = source local src = source
if data == 'travellingMerchant' then if data == 'travellingMerchant' then
return {table = stores.travel, des = '$', id = 'travellingMerchant', title = 'travelling Merchant'} return {table = stores.travel, des = '$', id = 'travellingMerchant', title = 'travelling Merchant'}
+2 -2
View File
@@ -122,7 +122,7 @@ CUI("weedgrinder", function(source, item)
local Player = getPlayer(src) local Player = getPlayer(src)
local has = Player.Functions.GetItemByName("drycannabis") local has = Player.Functions.GetItemByName("drycannabis")
if not has then Notifys(src, 'You Need Dried Cannabis', 'error') return end if not has then Notifys(src, 'You Need Dried Cannabis', 'error') return end
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Grinding Weed') local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
if not check then return end if not check then return end
if RemoveItem(src, "drycannabis",1 ) then if RemoveItem(src, "drycannabis",1 ) then
AddItem(src, "grindedweed", 1) AddItem(src, "grindedweed", 1)
@@ -132,7 +132,7 @@ end)
CUI("mdwoods", function(source, item) CUI("mdwoods", function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Breaking Blunt Open') local check = ps.callback('md-drugs:client:uncuff', src, 'Breaking Blunt Open')
if not check then return end if not check then return end
if RemoveItem(src, "mdwoods",1 ) then if RemoveItem(src, "mdwoods",1 ) then
AddItem(src, "bluntwrap", 5) AddItem(src, "bluntwrap", 5)
+1 -1
View File
@@ -27,7 +27,7 @@ for k, v in pairs (presses) do
CUI(v.item, function(source, item) CUI(v.item, function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
local check, loc = lib.callback.await('md-drugs:client:setpress', src, v.data) local check, loc = ps.callback('md-drugs:client:setpress', src, v.data)
if check then if check then
if RemoveItem(src, v.item, 1) then if RemoveItem(src, v.item, 1) then
table.insert(activePresses, { table.insert(activePresses, {
+27
View File
@@ -0,0 +1,27 @@
function loadFile(filePath)
local resourceName = 'md-drugs'
local fullScript = LoadResourceFile(resourceName, filePath)
if not fullScript then
ps.error("Error: Failed to load module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
return false
end
local chunk, err = load(fullScript, filePath, "t")
if not chunk then
ps.error("Error loading Lua chunk from '" .. filePath .. "': " .. tostring(err))
return false
end
local success, execErr = pcall(chunk)
if not success then
ps.error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr))
return false
end
ps.success("Successfully loaded module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
return true
end
for scriptName, toggle in pairs(Config.Drugs) do
if not toggle then goto continue end
loadFile('server/' .. scriptName .. '.lua')
::continue::
end
+22 -4
View File
@@ -1,5 +1,6 @@
Config = {} --Ignore. Config = {} --Ignore.
ps = exports.ps_lib:init() ps = exports.ps_lib:init()
ps.insertLang("en")
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)
@@ -22,12 +23,10 @@ Config.Tier1 = 100 -- amount to hit for level 2
Config.Tier2 = 300 -- amount to hit for level 3 Config.Tier2 = 300 -- amount to hit for level 3
---------------------------------- BRIDGE ---------------------------------- BRIDGE
Config.progressbartype = 'oxcir' -- either 'qb', 'oxcir', 'oxbar'
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 = 'qb' -- qb or ox
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,},
ps_maze = {timelimit = 15}, ps_maze = {timelimit = 15},
@@ -50,3 +49,22 @@ Config.minigametype = 'ox' -- look above for options or choose none if you dont
-------- Woah Where did like all the locations go? -------- Woah Where did like all the locations go?
--- read the readme to find out --- read the readme to find out
---
Config.Drugs = {
cocaine = true,
consumables =false,
crack = true,
cornerselling = false,
heroin = false,
deliveries = false,
lean = false,
lsd = false,
mescaline = false,
meth = false,
oxyruns = false,
pharma = false,
shrooms = false,
weed = false,
wholesale = false,
xtc = false,
}