From bcdf71b17a52c0701c3d8b571817d6d4039c4069 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 11 Nov 2024 20:22:48 -0800 Subject: [PATCH 01/36] check --- client/cocaine.lua | 22 ++-- client/functions.lua | 22 ++-- client/heroin.lua | 9 -- client/lean.lua | 9 -- client/lsd.lua | 9 -- client/meth.lua | 11 +- client/pedspawns.lua | 22 ++++ client/target.lua | 41 +++--- client/travellingmerchant.lua | 2 +- client/weed.lua | 18 +-- server/cocaine.lua | 70 ++++++---- server/crack.lua | 3 +- server/heroin.lua | 42 +++--- server/lsd.lua | 6 +- server/mescaline.lua | 40 ++++-- server/meth.lua | 4 +- server/shrooms.lua | 38 ++++-- server/targets.lua | 105 +++++++++++++++ server/weed.lua | 53 ++++++-- server/xtc.lua | 39 +++--- shared/config.lua | 232 ++-------------------------------- 21 files changed, 394 insertions(+), 403 deletions(-) create mode 100644 client/pedspawns.lua create mode 100644 server/targets.lua diff --git a/client/cocaine.lua b/client/cocaine.lua index 0c8b0b5..621e64d 100644 --- a/client/cocaine.lua +++ b/client/cocaine.lua @@ -53,7 +53,7 @@ RegisterNetEvent("md-drugs:client:makepowder", function(data) TriggerServerEvent("md-drugs:server:makepowder", data.data) end) -RegisterNetEvent("md-drugs:client:cutcokeone", function() +RegisterNetEvent("md-drugs:client:cutcokeone", function(data) if not ItemCheck('bakingsoda') then return end cuttingcoke = true if Config.FancyCokeAnims then @@ -61,11 +61,11 @@ RegisterNetEvent("md-drugs:client:cutcokeone", function() else if not progressbar(Lang.Coke.cutting, 5000, 'uncuff') then cuttingcoke = nil return end end - TriggerServerEvent("md-drugs:server:cutcokeone") + TriggerServerEvent("md-drugs:server:cutcokeone", data.data) cuttingcoke = nil end) -RegisterNetEvent("md-drugs:client:bagcoke", function() +RegisterNetEvent("md-drugs:client:bagcoke", function(data) if not ItemCheck('empty_weed_bag') then return end baggingcoke = true if Config.FancyCokeAnims then @@ -73,18 +73,20 @@ RegisterNetEvent("md-drugs:client:bagcoke", function() else if not progressbar(Lang.Coke.bagging, 5000, 'uncuff') then baggingcoke = nil return end end - TriggerServerEvent("md-drugs:server:bagcoke") + TriggerServerEvent("md-drugs:server:bagcoke", data.data) baggingcoke = nil end) CreateThread(function() + local config = lib.callback.await('md-drugs:server:getLocs', false) + if not config then return end if Config.FancyCokeAnims == false then - AddBoxZoneMulti('cuttcoke', Config.CuttingCoke, { type = "client", event = "md-drugs:client:cutcokeone", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.coke.cut}) - AddBoxZoneMulti('baggcoke', Config.BaggingCoke, { type = "client", event = "md-drugs:client:bagcoke", icon = "fa-solid fa-sack-xmark", label = Lang.targets.coke.bag}) + AddBoxZoneMulti('cuttcoke', config.CuttingCoke, { type = "client",event = "md-drugs:client:cutcokeone", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.coke.cut}) + AddBoxZoneMulti('baggcoke', config.BaggingCoke, { type = "client",event = "md-drugs:client:bagcoke", icon = "fa-solid fa-sack-xmark", label = Lang.targets.coke.bag}) else - AddBoxZoneSingle('cutcoke', vector3(1093.17, -3195.74, -39.19), - { 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 }) - AddBoxZoneSingle('bagcokepowder', vector3(1090.29, -3195.66, -39.13), - { 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 }) + 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 }) + 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) diff --git a/client/functions.lua b/client/functions.lua index d4ca65f..5ac1dbd 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -394,7 +394,7 @@ function AddBoxZoneSingle(name, loc, data) end end -function AddBoxZoneMulti(name, table, data) +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 @@ -557,11 +557,7 @@ end RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() Wait(3000) - LoadModel('prop_plant_01b') TriggerEvent('heroin:init') - LoadModel('prop_plant_01a') TriggerEvent('coke:init') - LoadModel('prop_cactus_03') TriggerEvent('Mescaline:init') - LoadModel('mushroom') TriggerEvent('shrooms:init') - LoadModel('bkr_prop_weed_lrg_01b') TriggerEvent('weed:init') + LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('mushroom') LoadModel('bkr_prop_weed_lrg_01b') local check = lib.callback.await('md-drugs:server:GetRep', false) return @@ -569,11 +565,7 @@ end) AddEventHandler('onResourceStart', function(resource) if resource == GetCurrentResourceName() then - LoadModel('prop_plant_01b') TriggerEvent('heroin:init') - LoadModel('prop_plant_01a') TriggerEvent('coke:init') - LoadModel('prop_cactus_03') TriggerEvent('Mescaline:init') - LoadModel('mushroom') TriggerEvent('shrooms:init') - LoadModel('bkr_prop_weed_lrg_01b') TriggerEvent('weed:init') + LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('mushroom') LoadModel('bkr_prop_weed_lrg_01b') end end) local active = false @@ -584,4 +576,12 @@ RegisterNetEvent('md-drugs:client:minusTier', function(data) if not progressbar('Cutting This ' ..GetLabel(data.item) .. ' More', 4000, 'uncuff') then return end TriggerServerEvent('md-drugs:server:AddMas', data) active = false +end) + +CreateThread(function() + TriggerEvent('heroin:init') + TriggerEvent('coke:init') + TriggerEvent('Mescaline:init') + TriggerEvent('shrooms:init') + TriggerEvent('weed:init') end) \ No newline at end of file diff --git a/client/heroin.lua b/client/heroin.lua index ca626e3..5e3ee00 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -18,15 +18,6 @@ local function pickher(loc) TriggerServerEvent("heroin:pickupCane", loc) end -CreateThread(function() -local Ped = "g_m_y_famdnf_01" - lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime) - local labkitlocation = Config.buyheroinlabkit - local heroinkitdealer = CreatePed(0, Ped, labkitlocation.x, labkitlocation.y, labkitlocation.z-1, labkitlocation.w, false, false) - Freeze(heroinkitdealer, true, labkitlocation.w) - AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil ) -end) - RegisterNetEvent('heroin:respawnCane', function(loc) local v = GlobalState.PoppyPlants[loc] local hash = GetHashKey(v.model) diff --git a/client/lean.lua b/client/lean.lua index 9ad6941..edb337c 100644 --- a/client/lean.lua +++ b/client/lean.lua @@ -1,14 +1,5 @@ local QBCore = exports['qb-core']:GetCoreObject() -CreateThread(function() - local current = "s_m_m_doctor_01" - lib.requestModel(current, Config.RequestModelTime) - local SyrupLocation = CreatePed(0, current,Config.SyrupVendor.x,Config.SyrupVendor.y,Config.SyrupVendor.z-1, Config.SyrupVendor.w, false, false) - Freeze(SyrupLocation, true, Config.SyrupVendor.w) - AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil ) -end) - - RegisterNetEvent("md-drugs:client:getsyruplocationtobuy", function() Notify(Lang.Lean.marked, "success") SpawnCarPedChase() diff --git a/client/lsd.lua b/client/lsd.lua index d4b8ea3..29a3ffb 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -15,15 +15,6 @@ local function createLabKit(coord, head) AddMultiModel(labkit, options, labkit) end -CreateThread(function() - local Ped = "g_m_y_famdnf_01" - lib.requestModel(Ped, Config.RequestModelTime) - local tabdealer = CreatePed(0, Ped,Config.buylsdlabkit.x,Config.buylsdlabkit.y,Config.buylsdlabkit.z-1, Config.buylsdlabkit.w, false, false) - Freeze(tabdealer, true, Config.buylsdlabkit.w) - AddSingleModel(tabdealer,{ type = "client", label = Lang.targets.lsd.buy, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buylabkit", distance = 2.0}, tabdealer ) -end) - - RegisterNetEvent("md-drugs:client:getlysergic", function(data) if not minigame() then return end if not progressbar(Lang.lsd.steallys, 4000, 'uncuff') then return end diff --git a/client/meth.lua b/client/meth.lua index f0c34d8..72d1511 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -82,8 +82,9 @@ CreateThread(function() end) CreateThread(function() - AddBoxZoneSingle("methTeleOut",Config.MethTeleIn, {name = 'teleout', icon = "fa-solid fa-door-open", label = Lang.targets.meth.enter, action = function() SetEntityCoords(PlayerPedId(), Config.MethTeleOut) end} ) - AddBoxZoneSingle("methtelein",Config.MethTeleOut, {name = 'teleout', icon = "fa-solid fa-door-closed", label = Lang.targets.meth.exit, action = function() SetEntityCoords(PlayerPedId(), Config.MethTeleIn) end} ) + local config = lib.callback.await('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("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 = { { name = 'methcook', icon = "fa-solid fa-temperature-high", label = Lang.targets.meth.cook, distance = 2.5, action = function() startcook() end, canInteract = function() @@ -109,8 +110,10 @@ CreateThread(function() if amonia and heated == nil then return true end end }) if Config.MethHeist == false then - AddBoxZoneMulti('methep', Config.MethEph, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.eph, event = 'md-drugs:client:stealeph'}) - AddBoxZoneMulti('methace', Config.Methace, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.ace, event = 'md-drugs:client:stealace'}) + local config = lib.callback.await('md-drugs:server:getLocs', false) + if not config then return end + AddBoxZoneMulti('methep', config.MethEph, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.eph, event = 'md-drugs:client:stealeph'}) + AddBoxZoneMulti('methace', config.Methace, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.ace, event = 'md-drugs:client:stealace'}) end end) diff --git a/client/pedspawns.lua b/client/pedspawns.lua new file mode 100644 index 0000000..be4338e --- /dev/null +++ b/client/pedspawns.lua @@ -0,0 +1,22 @@ +local QBCore = exports['qb-core']:GetCoreObject() + +local config = lib.callback.await('md-drugs:server:getLocs', false) + +CreateThread(function() + local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01'} + for k, v in pairs (model) do + lib.requestModel(v, Config.RequestModelTime) + end + local tabdealer = CreatePed(0, 'g_m_y_famdnf_01',config.singleSpot.buylsdlabkit.x,config.singleSpot.buylsdlabkit.y,config.singleSpot.buylsdlabkit.z-1,config.singleSpot.buylsdlabkit.w, false, false) + local heroinkitdealer = CreatePed(0,"g_m_y_famdnf_01",config.singleSpot.buyheroinlabkit.x, config.singleSpot.buyheroinlabkit.y, config.singleSpot.buyheroinlabkit.z-1, config.singleSpot.buyheroinlabkit.w, false, false) + local SyrupLocation = CreatePed(0, 's_m_m_doctor_01', config.singleSpot.SyrupVendor.x,config.singleSpot.SyrupVendor.y,config.singleSpot.SyrupVendor.z-1, config.singleSpot.SyrupVendor.w, false, false) + local WeedGuy = CreatePed(0,'u_m_m_jesus_01',config.singleSpot.WeedSaleman.x,config.singleSpot.WeedSaleman.y,config.singleSpot.WeedSaleman.z-1, config.singleSpot.WeedSaleman.w, false, false) + Freeze(tabdealer, true,config.singleSpot.buylsdlabkit.w) + Freeze(SyrupLocation, true, config.singleSpot.SyrupVendor.w) + Freeze(heroinkitdealer, true, config.singleSpot.buyheroinlabkit.w) + Freeze(WeedGuy, true, config.singleSpot.WeedSaleman.w) + AddSingleModel(tabdealer,{ type = "client", label = Lang.targets.lsd.buy, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buylabkit", distance = 2.0}, tabdealer ) + AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil ) + AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil ) + AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fas fa-eye", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil) +end) \ No newline at end of file diff --git a/client/target.lua b/client/target.lua index d114f66..bfaede9 100644 --- a/client/target.lua +++ b/client/target.lua @@ -1,23 +1,26 @@ local QBCore = exports['qb-core']:GetCoreObject() local icon = "fa solid fa-eye" + CreateThread(function() - AddBoxZoneSingle('telecokein', Config.CokeTeleIn, {action = function()tele(Config.CokeTeleOut)end, icon = 'fa-solid fa-door-open', label = Lang.targets.coke.enter}) -- coke - AddBoxZoneSingle('telecokeout', Config.CokeTeleOut, {action = function()tele(Config.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 = icon, label = Lang.targets.lsd.lys}) -- lsd - AddBoxZoneMulti('stealdiethylamide', Config.diethylamide, {event = "md-drugs:client:getdiethylamide", icon = icon, label = Lang.targets.lsd.die}) -- lsd - AddBoxZoneMulti('gettabs', Config.gettabs, {event = "md-drugs:client:buytabs", icon = icon, label = Lang.targets.lsd.buyt}) -- lsd - AddBoxZoneMulti('dryheroin', Config.dryplant, {event = "md-drugs:client:dryplant", icon = icon, label = Lang.targets.heroin.dry}) -- heroin - AddBoxZoneMulti('cutheroin', Config.cutheroinone, {event = "md-drugs:client:cutheroin", icon = icon, label = Lang.targets.heroin.cut}) -- heroin - AddBoxZoneMulti('fillneedle', Config.fillneedle, {event = "md-drugs:client:fillneedle", icon = icon, label = Lang.targets.heroin.fill}) -- heroin - AddBoxZoneMulti('makecrack', Config.makecrack, {event = "md-drugs:client:makecrackone", icon = icon, label = Lang.targets.crack.cook}) -- crack - AddBoxZoneMulti('bagcrack', Config.bagcrack, {event = "md-drugs:client:bagcrack", icon = icon, label = Lang.targets.crack.bag}) -- crack - AddBoxZoneMulti('fillprescription', Config.FillPrescription, {event = "md-drugs:client:fillprescription", icon = icon, label = Lang.targets.pha.fill}) -- pharma - AddBoxZoneSingle('payfortruck', Config.Payfortruck, {event = "md-drugs:client:GetOxyCar", icon = icon, label = Lang.targets.oxy.pay}) -- oxy runs - AddBoxZoneSingle('drymescaline', Config.DryOut, {event = "md-drugs:client:drymescaline", icon = icon, label = Lang.targets.mescaline.dry}) -- mescaline - AddBoxZoneMulti('stealisosafrole', Config.isosafrole, {event = "md-drugs:client:stealisosafrole", icon = icon, label = Lang.targets.xtc.iso}) -- xtc - AddBoxZoneMulti('stealmdp2p', Config.mdp2p, {event = "md-drugs:client:stealmdp2p", icon = icon, label = Lang.targets.xtc.mdp}) -- xtc - AddBoxZoneMulti('rawxtcloc', Config.rawxtcloc, {event = "md-drugs:client:makingrawxtc", icon = icon, label = Lang.targets.xtc.raw}) -- xtc - AddBoxZoneSingle('buypress', Config.buypress, {event = "md-drugs:client:buypress", icon = icon, label = Lang.targets.xtc.press}) -- xtc - AddBoxZoneMulti('stamp', Config.stamp, {event = "md-drugs:client:stampwhite", icon = icon, label = Lang.targets.xtc.stamp}) -- xtc + local config = lib.callback.await('md-drugs:server:getLocs', false) + if not config then return end + AddBoxZoneSingle('telecokein', config.singleSpot.CokeTeleIn, {action = function()tele(config.singelSpot.CokeTeleOut)end, icon = 'fa-solid fa-door-open', label = Lang.targets.coke.enter}) -- coke + AddBoxZoneSingle('telecokeout', config.singleSpot.CokeTeleOut, {action = function()tele(config.singelSpot.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 = icon, label = Lang.targets.lsd.lys}) -- lsd + AddBoxZoneMulti('stealdiethylamide', config.diethylamide, {event = "md-drugs:client:getdiethylamide", icon = icon, label = Lang.targets.lsd.die}) -- lsd + AddBoxZoneMulti('gettabs', config.gettabs, {event = "md-drugs:client:buytabs", icon = icon, label = Lang.targets.lsd.buyt}) -- lsd + AddBoxZoneMulti('dryheroin', config.dryplant, {event = "md-drugs:client:dryplant", icon = icon, label = Lang.targets.heroin.dry}) -- heroin + AddBoxZoneMulti('cutheroin', config.cutheroinone, {event = "md-drugs:client:cutheroin", icon = icon, label = Lang.targets.heroin.cut}) -- heroin + AddBoxZoneMulti('fillneedle', config.fillneedle, {event = "md-drugs:client:fillneedle", icon = icon, label = Lang.targets.heroin.fill}) -- heroin + AddBoxZoneMulti('makecrack', config.makecrack, {event = "md-drugs:client:makecrackone", icon = icon, label = Lang.targets.crack.cook}) -- crack + AddBoxZoneMulti('bagcrack', config.bagcrack, {event = "md-drugs:client:bagcrack", icon = icon, label = Lang.targets.crack.bag}) -- crack + AddBoxZoneMulti('fillprescription', config.FillPrescription, {event = "md-drugs:client:fillprescription", icon = icon, label = Lang.targets.pha.fill}) -- pharma + AddBoxZoneSingle('payfortruck', config.singleSpot.Payfortruck, {event = "md-drugs:client:GetOxyCar", icon = icon, label = Lang.targets.oxy.pay}) -- oxy runs + AddBoxZoneSingle('drymescaline', config.singleSpot.DryOut, {event = "md-drugs:client:drymescaline", icon = icon, label = Lang.targets.mescaline.dry}) -- mescaline + AddBoxZoneMulti('stealisosafrole', config.isosafrole, {event = "md-drugs:client:stealisosafrole", icon = icon, label = Lang.targets.xtc.iso}) -- xtc + AddBoxZoneMulti('stealmdp2p', config.mdp2p, {event = "md-drugs:client:stealmdp2p", icon = icon, label = Lang.targets.xtc.mdp}) -- xtc + AddBoxZoneMulti('rawxtcloc', config.rawxtcloc, {event = "md-drugs:client:makingrawxtc", icon = icon, label = Lang.targets.xtc.raw}) -- xtc + AddBoxZoneSingle('buypress', config.singleSpot.buypress, {event = "md-drugs:client:buypress", icon = icon, label = Lang.targets.xtc.press}) -- xtc + AddBoxZoneMulti('stamp', config.stamp, {event = "md-drugs:client:stampwhite", icon = icon, label = Lang.targets.xtc.stamp}) -- xtc end) diff --git a/client/travellingmerchant.lua b/client/travellingmerchant.lua index fd35cb4..d679f3a 100644 --- a/client/travellingmerchant.lua +++ b/client/travellingmerchant.lua @@ -1,7 +1,7 @@ local QBCore = exports['qb-core']:GetCoreObject() CreateThread(function() -local current = "g_m_y_famdnf_01" + local current = "g_m_y_famdnf_01" lib.requestModel(current, Config.RequestModelTime) local num = lib.callback.await('md-drugs:server:GetMerchant', false) local CurrentLocation = Config.Travellingmerchant[num] diff --git a/client/weed.lua b/client/weed.lua index 84de243..b146111 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -56,6 +56,7 @@ AddEventHandler('onResourceStop', function(resourceName) end) CreateThread(function() + local config = lib.callback.await('md-drugs:server:getLocs', false) AddBoxZoneMulti('weeddry', Config.WeedDry, { name = 'dryweed', icon = "fas fa-sign-in-alt", @@ -90,17 +91,17 @@ CreateThread(function() if hasJob() then return true end end }) -AddBoxZoneSingle('teleinweedout', Config.Teleout, { name = 'teleout', icon = "fas fa-sign-in-alt", label = Lang.targets.coke.exit, distance = 2.0, action = function() SetEntityCoords(PlayerPedId(),Config.Telein) end, +AddBoxZoneSingle('teleinweedout', config.singleSpot.weedTeleout, { name = 'teleout', icon = "fas fa-sign-in-alt", label = Lang.targets.coke.exit, distance = 2.0, action = function() SetEntityCoords(PlayerPedId(),config.singleSpot.weedTelein) end, canInteract = function() if hasJob() then return true end end }) -AddBoxZoneSingle('teleinweedin', Config.Telein, { name = 'teleout', icon = "fas fa-sign-in-alt", label = Lang.targets.coke.enter, distance = 2.0, action = function() SetEntityCoords(PlayerPedId(),Config.Teleout) end, +AddBoxZoneSingle('teleinweedin', config.singleSpot.weedTelein, { name = 'teleout', icon = "fas fa-sign-in-alt", label = Lang.targets.coke.enter, distance = 2.0, action = function() SetEntityCoords(PlayerPedId(),config.singleSpot.weedTeleout) end, canInteract = function() if hasJob() then return true end end }) -AddBoxZoneSingle('MakeButterCrafting', Config.MakeButter, {label = Lang.targets.weed.butt, action = function() lib.showContext('ButterCraft') end, icon = "fas fa-sign-in-alt", +AddBoxZoneSingle('MakeButterCrafting', config.singleSpot.MakeButter, {label = Lang.targets.weed.butt, action = function() lib.showContext('ButterCraft') end, icon = "fas fa-sign-in-alt", canInteract = function() if hasJob() then return true end end }) -AddBoxZoneSingle('makeoil',Config.MakeOil, { +AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, { name = 'Oil', icon = "fas fa-sign-in-alt", label = Lang.targets.weed.oil, @@ -158,15 +159,6 @@ if not progressbar('Doing Dabs', 4000, 'bong2') then return end AlienEffect() end) -CreateThread(function() - local current = "u_m_m_jesus_01" - lib.requestModel(current, Config.RequestModelTime) - local CurrentLocation = Config.WeedSaleman - local WeedGuy = CreatePed(0,current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false) - Freeze(WeedGuy, true, CurrentLocation.w) - AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fas fa-eye", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil) -end) - local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName) local options = {} local items = lib.callback.await('md-drugs:server:GetRecipe', false,'weed',tableName) diff --git a/server/cocaine.lua b/server/cocaine.lua index ddfc15b..d820702 100644 --- a/server/cocaine.lua +++ b/server/cocaine.lua @@ -1,9 +1,25 @@ local QBCore = exports['qb-core']:GetCoreObject() +local cokeplants = { + { location = vector3(1474.25, -2643.87, 42.88), heading = 334.49, model = "prop_plant_01a" }, + { location = vector3(1472.35, -2649.3, 41.87), heading = 329.56, model = "prop_plant_01a" }, + { location = vector3(1475.7, -2652.9, 40.8), heading = 25.16, model = "prop_plant_01a" }, + { location = vector3(1481.0, -2654.99, 39.86), heading = 21.52, model = "prop_plant_01a" }, + { location = vector3(1480.9, -2660.63, 38.68), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1477.18, -2666.53, 38.19), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1477.58, -2670.82, 37.73), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1476.56, -2675.82, 37.46), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1474.8, -2680.19, 37.03), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1471.52, -2685.0, 36.82), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1462.82, -2676.58, 38.83), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1461.31, -2667.74, 39.67), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1456.3, -2647.61, 43.39), heading = 202.97, model = "prop_plant_01a" }, + { location = vector3(1453.65, -2641.56, 45.0), heading = 202.97, model = "prop_plant_01a" }, +} -GlobalState.CocaPlant = Config.CocaPlant +GlobalState.CocaPlant = cokeplants Citizen.CreateThread(function() - for _, v in pairs(Config.CocaPlant) do + for _, v in pairs(cokeplants) do v.taken = false end end) @@ -11,31 +27,31 @@ end) function CaneCooldown(loc) CreateThread(function() Wait(Config.respawnTime * 1000) - Config.CocaPlant[loc].taken = false - GlobalState.CocaPlant = Config.CocaPlant + cokeplants[loc].taken = false + GlobalState.CocaPlant = cokeplants Wait(1000) TriggerClientEvent('coke:respawnCane', -1, loc) - Log('Coca Plant Respawned At ' .. Config.CocaPlant[loc].location, 'coke') + Log('Coca Plant Respawned At ' .. cokeplants[loc].location, 'coke') end) end RegisterNetEvent("coke:pickupCane") AddEventHandler("coke:pickupCane", function(loc) local src = source - if CheckDist(src, Config.CocaPlant[loc].location) then return end - if not Config.CocaPlant[loc].taken then - Config.CocaPlant[loc].taken = true - GlobalState.CocaPlant = Config.CocaPlant + --if CheckDist(src, Config.CocaPlant[loc].location) then return end + if not cokeplants[loc].taken then + cokeplants[loc].taken = true + GlobalState.CocaPlant = cokeplants TriggerClientEvent("coke:removeCane", -1, loc) CaneCooldown(loc) AddItem(src, 'coca_leaf', 1) - Log(GetName(src) .. ' Picked A Coca Leaf With a distance of ' .. dist(src, Config.CocaPlant[loc].location) .. ' vectors', 'coke') + --Log(GetName(src) .. ' Picked A Coca Leaf With a distance of ' .. dist(src, Config.CocaPlant[loc].location) .. ' vectors', 'coke') end end) RegisterServerEvent('md-drugs:server:makepowder', function(num) local src = source - if CheckDist(src, Config.MakePowder[num]['loc']) then return end + if not checkLoc(src, 'MakePowder', num) then return end local tier = 'tier1' local logMessage = ' Made Raw Coke' if Config.TierSystem then @@ -52,11 +68,16 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num) Log(GetName(src) .. logMessage .. dist(src, Config.MakePowder[num]['loc']) .. ' vectors', 'coke') end) -RegisterServerEvent('md-drugs:server:cutcokeone', function() +RegisterServerEvent('md-drugs:server:cutcokeone', function(num) local src = source local Player = getPlayer(src) local count = 0 - if Config.TierSystem then + if Config.FancyCokeAnims then + if not checkLoc(src, 'singleSpot', 'cutcoke') then return end + else + if not checkLoc(src, 'CuttingCoke', num) then return end + end + if Config.TierSystem then local tier = '' local cokeTiers = { {item = 'coke', tier = 'tier1', log = ' Cut Coke'}, @@ -65,12 +86,11 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function() } for _, v in ipairs(cokeTiers) do if count >= 1 then break end - if Player.Functions.GetItemByName(v.item) then - tier = v.tier + if Player.Functions.GetItemByName(v.item) then + tier = v.tier count = count + 1 end end - Notifys(src, Lang.Coke.nocutcoke, "error") if not GetRecipe(src, 'cocaine', 'cutcoke', tier) then return end else if not GetRecipe(src, 'cocaine', 'cutcoke', 'tier1') then return end @@ -78,11 +98,16 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function() end end) -RegisterServerEvent('md-drugs:server:bagcoke', function() +RegisterServerEvent('md-drugs:server:bagcoke', function(num) local src = source local Player = getPlayer(src) - local count = 0 + local count = 0 local tier = '' + if Config.FancyCokeAnims then + if not checkLoc(src, 'singleSpot', 'bagcokepowder') then return end + else + if not checkLoc(src, 'BaggingCoke', num) then return end + end if Config.TierSystem then local coke = getRep(src, 'coke') local cokeTiers = { @@ -92,14 +117,13 @@ RegisterServerEvent('md-drugs:server:bagcoke', function() } for _, v in ipairs(cokeTiers) do if Player.Functions.GetItemByName(v.item) then - if count >= 1 then break end - count = count + 1 + if count >= 1 then break end + count = count + 1 tier = v.tier end - end - if not GetRecipe(src, 'cocaine', 'bagcoke', tier) then return end + end + if not GetRecipe(src, 'cocaine', 'bagcoke', tier) then return end AddRep(src, 'coke') - Notifys(src, Lang.Coke.nobagcoke, "error") else if not GetRecipe(src, 'cocaine', 'bagcoke', 'tier1') then return end Log(GetName(src) .. ' Bagged Coke', 'coke') diff --git a/server/crack.lua b/server/crack.lua index 24ae1a0..6b41831 100644 --- a/server/crack.lua +++ b/server/crack.lua @@ -4,7 +4,7 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num) local src = source local Player = getPlayer(src) local count,type, tier = 0, 'cookcrack', 'tier1' - if CheckDist(src, Config.makecrack[num]['loc']) then return end + if not checkLoc(src, 'makecrack', num) then return end if Config.TierSystem then local crackTiers = { {item = 'loosecoke', tier = 'tier1', log = ' Cut Crack'}, @@ -30,6 +30,7 @@ RegisterServerEvent('md-drugs:server:bagcrack', function(num) local src = source local Player = getPlayer(src) local count,type, tier = 0, 'bagcrack', 'tier1' + if not checkLoc(src, 'bagcrack', num) then return end if Config.TierSystem then local crackTiers = { {item = 'crackrock', tier = 'tier1', log = ' Bagged Crack'}, diff --git a/server/heroin.lua b/server/heroin.lua index fb9b258..e6fb115 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -1,9 +1,23 @@ local QBCore = exports['qb-core']:GetCoreObject() GlobalState.PoppyPlants = Config.PoppyPlants - +local h = { + { location = vector3(-2251.3, -99.18, 100.11), heading = 334.49, model = "prop_plant_01b"}, + { location = vector3(-2249.63, -92.97, 101.8), heading = 329.56, model = "prop_plant_01b"}, + { location = vector3(-2245.57, -85.12, 104.5), heading = 25.16, model = "prop_plant_01b"}, + { location = vector3(-2240.81, -88.48, 105.88), heading = 21.52, model = "prop_plant_01b"}, + { location = vector3(-2240.87, -93.36, 103.88), heading = 334.49, model = "prop_plant_01b"}, + { location = vector3(-2236.0, -95.34, 102.55), heading = 329.56, model = "prop_plant_01b"}, + { location = vector3(-2240.6, -100.01, 100.49), heading = 25.16, model = "prop_plant_01b"}, + { location = vector3(-2246.29, -104.92, 99.27), heading = 21.52, model = "prop_plant_01b"}, + { location = vector3(-2243.64, -107.99, 96.71), heading = 334.49, model = "prop_plant_01b"}, + { location = vector3(-2254.22, -108.76, 97.25), heading = 329.56, model = "prop_plant_01b"}, + { location = vector3(-2247.33, -108.92, 97.70), heading = 25.16, model = "prop_plant_01b"}, + { location = vector3(-2250.96, -111.22, 97.50), heading = 21.52, model = "prop_plant_01b"}, + { location = vector3(465.95, -1021.32, 31.78), heading = 21.52, model = "prop_plant_01b"}, +} Citizen.CreateThread(function() - for _, v in pairs(Config.PoppyPlants) do + for _, v in pairs(h) do v.taken = false end end) @@ -12,11 +26,11 @@ end) function heroinCooldown(loc) CreateThread(function() Wait(Config.respawnTime * 1000) - Config.PoppyPlants[loc].taken = false - GlobalState.PoppyPlants = Config.PoppyPlants + h[loc].taken = false + GlobalState.PoppyPlants = h Wait(1000) TriggerClientEvent('heroin:respawnCane', -1, loc) - Log('Heroin Plant Respawned At ' .. Config.PoppyPlants[loc].location, 'heroin') + Log('Heroin Plant Respawned At ' .. h[loc].location, 'heroin') end) end @@ -32,20 +46,19 @@ end) RegisterServerEvent("heroin:pickupCane", function(loc) - if CheckDist(source, Config.PoppyPlants[loc].location) then return end - if not Config.PoppyPlants[loc].taken then - Config.PoppyPlants[loc].taken = true - GlobalState.PoppyPlants = Config.PoppyPlants + if not h[loc].taken then + h[loc].taken = true + GlobalState.PoppyPlants = h TriggerClientEvent("heroin:removeCane", -1, loc) heroinCooldown(loc) AddItem(source, 'poppyresin', 1) - Log(GetName(source) .. ' Picked A Poppies With a distance of ' .. dist(source, Config.PoppyPlants[loc].location) .. ' vectors', 'heroin') + Log(GetName(source) .. ' Picked A Poppies With a distance of ' .. dist(source, h[loc].location) .. ' vectors', 'heroin') end end) RegisterServerEvent('md-drugs:server:dryplant', function(num) local src = source - if CheckDist(source, Config.dryplant[num]['loc']) then return end + if not checkLoc(source, 'dryplant', num) then return end if not Itemcheck(source, 'poppyresin', 1) then return end if Config.TierSystem then local heroin = getRep(src, 'heroin') @@ -69,7 +82,7 @@ end) RegisterServerEvent('md-drugs:server:cutheroin', function(num) local src = source local Player = getPlayer(src) - if CheckDist(source, Config.cutheroinone[num]['loc']) then return end + if not checkLoc(source, 'cutheroinone', num) then return end if not Itemcheck(src, 'bakingsoda', 1) then return end if Config.TierSystem then local rawh = Player.Functions.GetItemByName('heroin') @@ -96,8 +109,7 @@ end) RegisterServerEvent('md-drugs:server:getheroinlabkit', function() local src = source local Player = getPlayer(src) - - if CheckDist(source, vector3(Config.buyheroinlabkit.x,Config.buyheroinlabkit.y,Config.buyheroinlabkit.z)) then return end + if not checkLoc(source, 'singleSpot', 'buyheroinlabkit') then return end if Player.Functions.RemoveMoney('cash', Config.heroinlabkitprice) then AddItem(src, 'heroinlabkit', 1) Log(GetName(src) ..' Bought A Heroin lab Kit ' .. dist(source, vector3(Config.buyheroinlabkit.x,Config.buyheroinlabkit.y,Config.buyheroinlabkit.z)) .. ' vectors', 'heroin') @@ -175,7 +187,7 @@ end) RegisterServerEvent('md-drugs:server:fillneedle', function(num) local src = source local Player = getPlayer(src) - if CheckDist(source, Config.fillneedle[num]['loc']) then return end + if not checkLoc(source, 'fillneedle', num) then return end if not Itemcheck(src, 'needle', 1) then return end if Config.TierSystem then local heroin = getRep(src, 'heroin') diff --git a/server/lsd.lua b/server/lsd.lua index 3691c40..6e97eba 100644 --- a/server/lsd.lua +++ b/server/lsd.lua @@ -2,7 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject() RegisterServerEvent('md-drugs:server:getlysergic', function(num) local src = source - if CheckDist(src, Config.lysergicacid[num]['loc']) then return end + if not checkLoc(src, 'lysergicacid', num) then return end if AddItem(src,'lysergic_acid', 2) then Log(GetName(src) ..' Got Lysergic acid with a distance of ' .. dist(source, Config.lysergicacid[num]['loc']) .. '!', 'lsd') end @@ -10,7 +10,7 @@ end) RegisterServerEvent('md-drugs:server:getdiethylamide', function(num) local src = source - if CheckDist(src, Config.diethylamide[num]['loc']) then return end + if not checkLoc(src, 'diethylamide', num) then return end if AddItem(src,'diethylamide', 2) then Log(GetName(src) ..' Got Diethylamide with a distance of ' .. dist(source, Config.diethylamide[num]['loc']) .. '!', 'lsd') end @@ -105,7 +105,7 @@ end) RegisterServerEvent('md-drugs:server:gettabpaper', function(num) local src = source local Player = getPlayer(src) - if CheckDist(source, Config.gettabs[num]['loc']) then return end + if not checkLoc(src, 'gettabs', num) then return end if Player.Functions.RemoveMoney('cash', Config.tabcost * 10) then AddItem(src,'tab_paper', 10) Log(GetName(src) ..' Bought Tab Paper!', 'lsd') diff --git a/server/mescaline.lua b/server/mescaline.lua index 63a361f..277af2e 100644 --- a/server/mescaline.lua +++ b/server/mescaline.lua @@ -1,8 +1,26 @@ local QBCore = exports['qb-core']:GetCoreObject() GlobalState.Mescaline = Config.Mescaline - +local m = { + { location = vector3(2598.73, 4207.89, 41.02), heading = 334.49, model = "prop_cactus_03"}, + { location = vector3(2601.46, 4199.34, 40.62), heading = 329.56, model = "prop_cactus_03"}, + { location = vector3(2611.63, 4194.18, 41.18), heading = 25.16, model = "prop_cactus_03"}, + { location = vector3(2620.18, 4202.69, 41.5), heading = 21.52, model = "prop_cactus_03"}, + { location = vector3(2624.26, 4211.75, 42.34), heading = 334.49, model = "prop_cactus_03"}, + { location = vector3(2635.21, 4207.5, 42.49), heading = 329.56, model = "prop_cactus_03"}, + { location = vector3(2644.97, 4193.51, 42.11), heading = 25.16, model = "prop_cactus_03"}, + { location = vector3(2654.21, 4195.31, 41.23), heading = 21.52, model = "prop_cactus_03"}, + { location = vector3(2653.32, 4206.49, 41.62), heading = 334.49, model = "prop_cactus_03"}, + { location = vector3(2647.45, 4213.94, 42.49), heading = 329.56, model = "prop_cactus_03"}, + { location = vector3(2636.3, 4218.49, 43.03), heading = 25.16, model = "prop_cactus_03"}, + { location = vector3(2627.37, 4223.2, 42.88), heading = 21.52, model = "prop_cactus_03"}, + { location = vector3(2617.86, 4230.38, 42.63), heading = 21.52, model = "prop_cactus_03"}, + { location = vector3(2609.8, 4222.12, 41.19), heading = 21.52, model = "prop_cactus_03"}, + { location = vector3(2602.96, 4194.05, 41.01), heading = 21.52, model = "prop_cactus_03"}, + { location = vector3(2614.39, 4188.3, 41.68), heading = 21.52, model = "prop_cactus_03"}, + { location = vector3(2623.82, 4189.97, 41.44), heading = 21.52, model = "prop_cactus_03"}, +} Citizen.CreateThread(function() - for _, v in pairs(Config.Mescaline) do + for _, v in pairs(m) do v.taken = false end end) @@ -10,29 +28,29 @@ end) function MescalineCooldown(loc) CreateThread(function() Wait(Config.respawnTime * 1000) - Config.Mescaline[loc].taken = false - GlobalState.Mescaline = Config.Mescaline - Wait(1000) + m[loc].taken = false + GlobalState.Mescaline = m TriggerClientEvent('Mescaline:respawnCane', -1, loc) - Log('Cactus Respawned At ' .. Config.Mescaline[loc].location, 'mescaline') + Log('Cactus Respawned At ' ..m[loc].location, 'mescaline') end) end RegisterNetEvent("Mescaline:pickupCane", function(loc) - if CheckDist(source, Config.Mescaline[loc].location) then return end - if not Config.Mescaline[loc].taken then - Config.Mescaline[loc].taken = true - GlobalState.Mescaline = Config.Mescaline + if CheckDist(source, m[loc].location) then return end + if not m[loc].taken then + m[loc].taken = true + GlobalState.Mescaline = m TriggerClientEvent("Mescaline:removeCane", -1, loc) MescalineCooldown(loc) AddItem(source,'cactusbulb', 1) - Log(GetName(source) .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, Config.Mescaline[loc].location) .. ' vectors', 'mescaline') + Log(GetName(source) .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, m[loc].location) .. ' vectors', 'mescaline') end end) RegisterNetEvent("md-drugs:server:drymescaline", function() local src = source + if not checkLoc(src, 'singleSpot', 'DryOut') then return end if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end Log(GetName(source) .. ' Dried Mescaline', 'mescaline') end) diff --git a/server/meth.lua b/server/meth.lua index d510837..cbd0ba0 100644 --- a/server/meth.lua +++ b/server/meth.lua @@ -30,7 +30,7 @@ end) RegisterServerEvent('md-drugs:server:geteph', function(num) local src = source - if CheckDist(src, Config.MethEph[num]['loc']) then return end + if not checkLoc(src, 'MethEph', num) then return end if AddItem(src, 'ephedrine', 1) then Notifys(src, 'Got Ephedrine!', "success") Log(GetName(src) .. ' Got ' .. 1 .. 'Of Ephedrine', 'Meth') @@ -39,7 +39,7 @@ end) RegisterServerEvent('md-drugs:server:getace', function(num) local src = source - if CheckDist(src, Config.Methace[num]['loc']) then return end + if not checkLoc(src, 'Methace', num) then return end if AddItem(src, 'acetone', 1) then Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth') Notifys(src, 'Got Acetone!', "success") diff --git a/server/shrooms.lua b/server/shrooms.lua index fcb2c59..781ef7a 100644 --- a/server/shrooms.lua +++ b/server/shrooms.lua @@ -1,9 +1,27 @@ local QBCore = exports['qb-core']:GetCoreObject() GlobalState.shrooms = Config.shrooms - +local s = { + { location = vector3(2185.14, 5183.81, 57.48), heading = 334.49, model = "mushroom"}, + { location = vector3(2174.45, 5187.85, 57.43), heading = 329.56, model = "mushroom"}, + { location = vector3(2166.22, 5196.56, 58.0), heading = 25.16, model = "mushroom"}, + { location = vector3(2166.82, 5204.83, 58.63), heading = 21.52, model = "mushroom"}, + { location = vector3(2174.84, 5205.82, 59.19), heading = 334.49, model = "mushroom"}, + { location = vector3(2184.46, 5201.23, 59.2), heading = 329.56, model = "mushroom"}, + { location = vector3(2192.45, 5194.89, 58.86), heading = 25.16, model = "mushroom"}, + { location = vector3(2207.53, 5187.81, 58.95), heading = 21.52, model = "mushroom"}, + { location = vector3(2213.46, 5191.11, 59.81), heading = 334.49, model = "mushroom"}, + { location = vector3(2218.31, 5180.0, 58.18), heading = 329.56, model = "mushroom"}, + { location = vector3(2212.75, 5172.35, 57.2), heading = 25.16, model = "mushroom"}, + { location = vector3(2208.56, 5167.06, 56.34), heading = 21.52, model = "mushroom"}, + { location = vector3(2196.9, 5158.59, 54.84), heading = 21.52, model = "mushroom"}, + { location = vector3(2191.62, 5174.91, 56.68), heading = 21.52, model = "mushroom"}, + { location = vector3(2190.18, 5182.54, 57.47), heading = 21.52, model = "mushroom"}, + { location = vector3(2185.85, 5190.49, 58.1), heading = 21.52, model = "mushroom"}, + { location = vector3(2179.95, 5194.19, 58.26), heading = 21.52, model = "mushroom"}, +} Citizen.CreateThread(function() - for _, v in pairs(Config.shrooms) do + for _, v in pairs(s) do v.taken = false end end) @@ -12,23 +30,23 @@ end) function shroomsCooldown(loc) CreateThread(function() Wait(Config.respawnTime * 1000) - Config.shrooms[loc].taken = false - GlobalState.shrooms = Config.shrooms + s[loc].taken = false + GlobalState.shrooms = s Wait(1000) TriggerClientEvent('shrooms:respawnCane', -1, loc) - Log('Cactus Respawned At ' .. Config.shrooms[loc].location, 'shrooms') + Log('Cactus Respawned At ' .. s[loc].location, 'shrooms') end) end RegisterNetEvent("shrooms:pickupCane", function(loc) - if CheckDist(source, Config.shrooms[loc].location) then return end - if not Config.shrooms[loc].taken then - Config.shrooms[loc].taken = true - GlobalState.shrooms = Config.shrooms + if CheckDist(source, s[loc].location) then return end + if not s[loc].taken then + s[loc].taken = true + GlobalState.shrooms = s TriggerClientEvent("shrooms:removeCane", -1, loc) shroomsCooldown(loc) AddItem(source, 'shrooms', 1) - Log(GetName(source) .. ' Picked A Shroom With a distance of ' .. dist(source, Config.shrooms[loc].location) .. ' vectors', 'shrooms') + Log(GetName(source) .. ' Picked A Shroom With a distance of ' .. dist(source,s[loc].location) .. ' vectors', 'shrooms') end end) diff --git a/server/targets.lua b/server/targets.lua new file mode 100644 index 0000000..f5e6676 --- /dev/null +++ b/server/targets.lua @@ -0,0 +1,105 @@ +local Target = { + MakePowder = { + {loc = vector3(1086.20, -3195.30, -39.20), 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 = ""}, + }, + CuttingCoke = { + {loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + BaggingCoke = { + {loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + makecrack = { + {loc = vector3(2434.07, 4969.39, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + bagcrack = { + {loc = vector3(2435.85, 4965.3, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + lysergicacid = { + {loc = vector3(-1381.21, -327.75, 39.85), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + {loc = vector3(2405.53, 5008.39, 46.02), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + diethylamide = { + {loc = vector3(-1371.71, -316.02, 39.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + {loc = vector3(2408.38, 5011.18, 46.08), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + gettabs = { + {loc = vector3(-1370.77, -314.51, 39.58), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + {loc = vector3(2409.59, 5012.45, 46.09), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + dryplant = { + {loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + cutheroinone = { + {loc = vector3(-1360.14, -337.03, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + fillneedle = { + {loc = vector3(-1366.32, -334.40, 44.44), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + isosafrole = { + {loc = vector3(844.39, -902.92, 25.42), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + mdp2p = { + {loc = vector3(844.4, -898.79, 25.23), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + rawxtcloc = { + {loc = vector3(844.71, -910.33, 25.37), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + stamp = { + {loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + FillPrescription = { + {loc = vector3(2432.89, 4252.2, 36.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + singleSpot = { + cutcoke = vector3(1093.17, -3195.74, -39.19), + bagcokepowder = vector3(1090.29, -3195.66, -39.13), + CokeTeleIn = vector3(198.16, -1276.92, 29.33), + CokeTeleOut = vector3(1088.81, -3187.57, -38.99), + buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), + buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13), + buypress = vector3(845.82, -884.79, 25.18), + DryOut = vector3(2638.22, 4237.93, 44.78), + SyrupVendor = vector4(365.21, -578.77, 39.30, 347.23), + weedTelein = vector3(244.74, 374.54, 105.74), + weedTeleout = vector3(1066.31, -3183.36, -39.16), + MakeButter = vector3(1045.48, -3198.49, -38.22), + MakeOil = vector3(1038.90, -3198.66, -38.17), + WeedSaleman = vector4(1030.77, -3203.18, -38.2, 262.37), + MethTeleIn = vector3(-2222.04, 303.99, 174.6), + MethTeleOut = vector3(996.91, -3200.83, -36.39), + MethHeistStart = vector3(-1102.93, -3066.76, 14.00), + truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95), + Payfortruck = vector3(1437.64, -1491.91, 63.62) + }, + MethEph = { + {loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + Methace = { + {loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + } +} + +function checkLoc(source, event, num) + local ped = source + local pos = GetPlayerPed(ped) + local coord = GetEntityCoords(pos) + local loc = '' + if type(num) =='string' then + loc = Target[event][num] + else + loc = Target[event][num].loc + end + local dist = #(coord - loc) + if dist < 2.5 then + return true + else + Notifys(source, 'You are not in the correct location', 'error') + return false + end +end + +lib.callback.register('md-drugs:server:getLocs', function() + return Target +end) \ No newline at end of file diff --git a/server/weed.lua b/server/weed.lua index 7bd8cf2..31b4afb 100644 --- a/server/weed.lua +++ b/server/weed.lua @@ -1,10 +1,43 @@ local QBCore = exports['qb-core']:GetCoreObject() - -GlobalState.WeedPlant = Config.WeedPlant +local weedPlant = { + { location = vector3(1049.63, -3202.12, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1050.85, -3202.15, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1052.01, -3202.22, -39.13), heading = 25.16, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1052.99, -3202.15, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1053.08, -3201.11, -39.13), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1052.91, -3199.99, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1053.02, -3198.97, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1051.95, -3198.93, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1051.96, -3199.86, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1051.93, -3201.17, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1050.98, -3201.13, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1050.89, -3200.07, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1050.89, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.72, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.98, -3200.1, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.82, -3201.01, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1053.07, -3194.51, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1052.97, -3195.55, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1052.82, -3196.58, -39.15), heading = 25.16, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1052.94, -3197.59, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1051.92, -3197.54, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1051.88, -3196.61, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1051.82, -3195.52, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1051.95, -3194.38, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1050.88, -3194.31, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1050.78, -3195.29, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1050.76, -3196.49, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1050.77, -3197.62, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.64, -3197.61, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.64, -3196.59, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.62, -3195.51, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.66, -3194.36, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, +} +GlobalState.WeedPlant = weedPlant Citizen.CreateThread(function() - for _, v in pairs(Config.WeedPlant) do + for _, v in pairs(weedPlant) do v.taken = false end end) @@ -12,23 +45,23 @@ end) function WeedCooldown(loc) CreateThread(function() Wait(Config.respawnTime * 1000) - Config.WeedPlant[loc].taken = false - GlobalState.WeedPlant = Config.WeedPlant + weedPlant[loc].taken = false + GlobalState.WeedPlant = weedPlant Wait(1000) TriggerClientEvent('weed:respawnCane', -1, loc) - Log('Weed Plant Respawned At ' .. Config.WeedPlant[loc].location, 'weed') + Log('Weed Plant Respawned At ' .. weedPlant[loc].location, 'weed') end) end RegisterNetEvent("weed:pickupCane", function(loc) local src = source - if not Config.WeedPlant[loc].taken then - Config.WeedPlant[loc].taken = true - GlobalState.WeedPlant = Config.WeedPlant + if not weedPlant[loc].taken then + weedPlant[loc].taken = true + GlobalState.WeedPlant = weedPlant TriggerClientEvent("weed:removeCane", -1, loc) WeedCooldown(loc) AddItem(src, 'wetcannabis', 1) - Log(GetName(source) .. ' Picked Weed With a distance of ' .. dist(source, Config.WeedPlant[loc].location) .. ' vectors', 'weed') + Log(GetName(source) .. ' Picked Weed With a distance of ' .. dist(source, weedPlant[loc].location) .. ' vectors', 'weed') end end) --------------- events diff --git a/server/xtc.lua b/server/xtc.lua index 31a0e70..2d5a38d 100644 --- a/server/xtc.lua +++ b/server/xtc.lua @@ -3,7 +3,7 @@ local QBCore = exports['qb-core']:GetCoreObject() RegisterServerEvent('md-drugs:server:stealisosafrole', function(num) local src = source local Player = getPlayer(src) - if CheckDist(source, Config.isosafrole[num]['loc']) then return end + if not checkLoc(src, 'isosafrole',num) then return end if AddItem(src, "isosafrole", 1) then Log(GetName(source) .. ' Stole isosafrole with a distance of ' .. dist(source, Config.isosafrole[num]['loc']) .. ' vectors!', 'xtc') end @@ -12,7 +12,7 @@ end) RegisterServerEvent('md-drugs:server:stealmdp2p', function(num) local src = source local Player = getPlayer(src) - if CheckDist(source, Config.mdp2p[num]['loc']) then return end + if not checkLoc(src, 'mdp2p',num) then return end if AddItem(src,"mdp2p", 1) then Log(GetName(source) .. ' Stole MDP2P with a distance of ' .. dist(source, Config.mdp2p[num]['loc']) .. ' vectors!', 'xtc') end @@ -153,25 +153,25 @@ end) ------------- making powder RegisterServerEvent('md-drugs:server:makingrawxtc', function(num) - local src = source - local Player = getPlayer(src) - if CheckDist(source, Config.rawxtcloc[num]['loc']) then return end + local src = source + local Player = getPlayer(src) + if not checkLoc(src, 'rawxtcloc',num) then return end if not GetRecipe(src, 'xtc', 'raw', 'raw_xtc') then return end Log(GetName(source) .. ' Made Raw XTC With A Distance Of ' .. dist(source, Config.rawxtcloc[num]['loc']) .. '!', 'xtc') end) RegisterServerEvent('md-drugs:server:stampwhite', function(num) - local src = source - local Player = getPlayer(src) - local one = {'white_playboys', 'white_aliens', 'white_pl', 'white_trolls', 'white_cats'} - local chance = math.random(#one) - local two = {'white_playboys2', 'white_aliens2', 'white_pl2', 'white_trolls2', 'white_cats2'} - local chance2 = math.random(#one) - local three = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'} - local chance3 = math.random(#one) - local four = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'} - local chance4 = math.random(#one) - if CheckDist(source, Config.stamp[num]['loc']) then return end + local src = source + local Player = getPlayer(src) + local one = {'white_playboys', 'white_aliens', 'white_pl', 'white_trolls', 'white_cats'} + local chance = math.random(#one) + local two = {'white_playboys2', 'white_aliens2', 'white_pl2', 'white_trolls2', 'white_cats2'} + local chance2 = math.random(#one) + local three = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'} + local chance3 = math.random(#one) + local four = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'} + local chance4 = math.random(#one) + if not checkLoc(src, 'stamp', num) then return end if RemoveItem(src, "white_xtc", 1) then AddItem(src, one[chance], 1) @@ -202,7 +202,7 @@ RegisterServerEvent('md-drugs:server:stampred', function(num) local four = {'red_playboys4', 'red_aliens4', 'red_pl4', 'red_trolls4', 'red_cats4'} local chance4 = math.random(#one) local playerPed = GetPlayerPed(source) - if CheckDist(source, Config.stamp[num]['loc']) then return end + if not checkLoc(src, 'stamp', num) then return end if RemoveItem(src, "red_xtc", 1) then AddItem(src, one[chance], 1) @@ -233,7 +233,7 @@ RegisterServerEvent('md-drugs:server:stamporange', function(num) local four = {'orange_playboys4', 'orange_aliens4', 'orange_pl4', 'orange_trolls4', 'orange_cats4'} local chance4 = math.random(#one) local playerPed = GetPlayerPed(source) - if CheckDist(source, Config.stamp[num]['loc']) then return end + if not checkLoc(src, 'stamp', num) then return end if RemoveItem(src, "orange_xtc", 1) then AddItem(src, one[chance], 1) @@ -264,8 +264,7 @@ RegisterServerEvent('md-drugs:server:stampblue', function(num) local four = {'blue_playboys4', 'blue_aliens4', 'blue_pl4', 'blue_trolls4', 'blue_cats4'} local chance4 = math.random(#one) local playerPed = GetPlayerPed(source) - if CheckDist(source, Config.stamp[num]['loc']) then return end - Log(GetName(source) .. ' Stamped A Single Blue Pill And Got ' .. one[chance] .. '!', 'xtc') + if not checkLoc(src, 'stamp', num) then return end if RemoveItem(src, "blue_xtc", 1) then AddItem(src, one[chance], 1) elseif RemoveItem(src, "blue_xtc2", 1) then diff --git a/shared/config.lua b/shared/config.lua index 8cfc0fb..64f3f57 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -1,7 +1,7 @@ Config = {} --Ignore. Config.Target = 'ox' -- qb or ox -Config.respawnTime = 150 -- Seconds +Config.respawnTime = 10 -- Seconds 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.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total @@ -37,96 +37,16 @@ Config.Minigames = { } Config.minigametype = 'ox' -- look above for options or choose none if you dont want any minigames - ------------- you can either set a gang or leave it blank, if blank it will autopopulate data to not require it :) +---- +--- ------------- Cocaine -- new animations require to be in a certain spot or they get fucky. uses bob74 ipl if you turn Config.FancyCokeAnims you can put it anywhere :) -Config.FancyCokeAnims = true -- if you want multi location this needs to be false - -Config.CokeTeleIn = vector3(198.16, -1276.92, 29.33)-- where you target to go inside - -Config.CokeTeleOut = vector3(1088.81, -3187.57, -38.99) -- where you target to leave - -Config.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(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 = ""}, -} -Config.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 = ""}, -} -Config.BaggingCoke = { -- only active if Config.FancyCokeAnims = false - {loc = vector3(1100.3, -3199.42, -39.19), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} ----------------- Crack locations -Config.makecrack = { -- make crack with baking soda with cut coke 1-3 - {loc = vector3(2434.07, 4969.39, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.bagcrack = { --- bag crack 1-3 stages - {loc = vector3(2435.85, 4965.3, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} -------------------------- LSD Locations -Config.lysergicacid = { -- get lysergic acid - {loc = vector3(-1381.21, -327.75, 39.85), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, - {loc = vector3(2405.53, 5008.39, 46.02), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.diethylamide = { -- get diethylamide - {loc = vector3(-1371.71, -316.02, 39.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, - {loc = vector3(2408.38, 5011.18, 46.08), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.gettabs = { -- buy tab paper - {loc = vector3(-1370.77, -314.51, 39.58), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, - {loc = vector3(2409.59, 5012.45, 46.09), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51)-- buy lab kit +Config.FancyCokeAnims = false -- if you want multi location this needs to be false Config.tabcost = 100 -- price per piece of tab paper event does 10 at a time Config.lsdlabkitcost = 10000 -- price of the lsd lab kit -------------------------- Heroin Locations - -Config.dryplant = { -- turn resin into powder - {loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.cutheroinone = { -- cut heroin stage 1-3 with baking soda - {loc = vector3(-1360.14, -337.03, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.fillneedle = { -- fill needles with heroin - {loc = vector3(-1366.32, -334.40, 44.44), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13) -- buy heroin lab kit Config.heroinlabkitprice = 10000 -- price of the lsd lab kit - ------------- XTC -Config.isosafrole = { -- where to steal isosafrole - {loc = vector3(844.39, -902.92, 25.42), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.mdp2p = { -- where to steal mdp2p - {loc = vector3(844.4, -898.79, 25.23), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.rawxtcloc = { -- where to combine the 2 ingridents to make raw xtc - {loc = vector3(844.71, -910.33, 25.37), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.stamp = { -- where to stamp pills - {loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - -Config.buypress = vector3(845.82, -884.79, 25.18)-- Where you buy your presses - ------ mescaline -Config.DryOut = vector3(2638.22, 4237.93, 44.78) -- Place to dry out mescaline into usuable drug Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline - - -------------- lean -Config.SyrupVendor = vector4(365.21, -578.77, 39.30, 347.23) -- where the mission ped starts Config.StartLoc = { vector3(-2307.22, 434.77, 174.47), -- where the truck spawns @@ -135,19 +55,9 @@ Config.StartLoc = { } ---------- Pharma - -Config.FillPrescription = {---------- this is where you want people to take their prescription to get a bottle of pills. They use bottle to get a random amount of prescription pills - {loc = vector3(2432.89, 4252.2, 36.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - Config.PharmaJob = "ems" -- what TYPE role you need to be on to get the command --------------- weed -Config.Teleout = vector3(1066.31, -3183.36, -39.16) -- where you target to tele in -Config.Telein = vector3(244.74, 374.54, 105.74) -- where you target to tele out -Config.MakeButter = vector3(1045.48, -3198.49, -38.22) -- where you make cannabutter and baked edibles -Config.MakeOil = vector3(1038.90, -3198.66, -38.17) -- where you make shatter -Config.WeedSaleman = vector4(1030.77, -3203.18, -38.2, 262.37) +-------------- weed Config.WeedDry = { -- where you dry leaves {loc = vector3(1043.0, -3191.59, -38.39),}, {loc = vector3(1041.0, -3191.59, -38.39),}, @@ -180,10 +90,6 @@ Config.Travellingmerchant = { ------------ these are the random locations the me --------------------------------------- oxy runs ---- How oxyruns work. You pay for a truck, you get in it and it gives a route. There is a 20% chance that the car will be "hot" and you have to ditch it. No Routes will spawn if that pops up ----- when you get to the drop off point third eye the truck. You will carry a box to the ped. He will give you cash, some oxy and maybe a random item. Rinse and repeat - - -Config.truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95) --- where the truck will spawn when you pay for it -Config.Payfortruck = vector3(1437.64, -1491.91, 63.62) --- where you pay for the truck Config.TruckPrice = 500 -- amount the truck will cost to rent Config.OxyRunCompleteCash = 200 -- base price you get for completeing a run. 50% if the car needs to be ditched Config.OxyRunDitchChance = 20 -- % of a fail mission and having to ditch the car and not get a new order @@ -207,131 +113,11 @@ Config.oxylocations = { -- These are different locations where a ped spawns. } Config.OxyRandItems = { -- random items you get for completing the mission -"oxy", -"lockpick", -"cryptostick", + "oxy", + "lockpick", + "cryptostick", } ---------------------- Meth Config -Config.MethTeleIn = vector3(-2222.04, 303.99, 174.6) -- where you target to tele in -Config.MethTeleOut = vector3(996.91, -3200.83, -36.39) -- where you target to tele out -Config.MethHeist = false -Config.MethHeistStart = vector3(-1102.93, -3066.76, 14.00) -- where you get the mission to get ingridients if meth heist = true -Config.MethEph = { - {loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} -Config.Methace = { - {loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, -} - ------------------------------ these are the locations where props will be spawned to be picked -Config.CocaPlant = { - { location = vector3(1474.25, -2643.87, 42.88), heading = 334.49, model = "prop_plant_01a" }, - { location = vector3(1472.35, -2649.3, 41.87), heading = 329.56, model = "prop_plant_01a" }, - { location = vector3(1475.7, -2652.9, 40.8), heading = 25.16, model = "prop_plant_01a" }, - { location = vector3(1481.0, -2654.99, 39.86), heading = 21.52, model = "prop_plant_01a" }, - { location = vector3(1480.9, -2660.63, 38.68), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1477.18, -2666.53, 38.19), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1477.58, -2670.82, 37.73), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1476.56, -2675.82, 37.46), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1474.8, -2680.19, 37.03), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1471.52, -2685.0, 36.82), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1462.82, -2676.58, 38.83), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1461.31, -2667.74, 39.67), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1456.3, -2647.61, 43.39), heading = 202.97, model = "prop_plant_01a" }, - { location = vector3(1453.65, -2641.56, 45.0), heading = 202.97, model = "prop_plant_01a" }, -} - -Config.WeedPlant = { - { location = vector3(1049.63, -3202.12, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.85, -3202.15, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.01, -3202.22, -39.13), heading = 25.16, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.99, -3202.15, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1053.08, -3201.11, -39.13), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.91, -3199.99, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1053.02, -3198.97, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.95, -3198.93, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.96, -3199.86, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.93, -3201.17, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.98, -3201.13, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.89, -3200.07, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.89, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.72, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.98, -3200.1, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.82, -3201.01, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1053.07, -3194.51, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.97, -3195.55, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.82, -3196.58, -39.15), heading = 25.16, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.94, -3197.59, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.92, -3197.54, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.88, -3196.61, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.82, -3195.52, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.95, -3194.38, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.88, -3194.31, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.78, -3195.29, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.76, -3196.49, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.77, -3197.62, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.64, -3197.61, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.64, -3196.59, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.62, -3195.51, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.66, -3194.36, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, -} - - -Config.PoppyPlants = { - { location = vector3(-2251.3, -99.18, 100.11), heading = 334.49, model = "prop_plant_01b"}, - { location = vector3(-2249.63, -92.97, 101.8), heading = 329.56, model = "prop_plant_01b"}, - { location = vector3(-2245.57, -85.12, 104.5), heading = 25.16, model = "prop_plant_01b"}, - { location = vector3(-2240.81, -88.48, 105.88), heading = 21.52, model = "prop_plant_01b"}, - { location = vector3(-2240.87, -93.36, 103.88), heading = 334.49, model = "prop_plant_01b"}, - { location = vector3(-2236.0, -95.34, 102.55), heading = 329.56, model = "prop_plant_01b"}, - { location = vector3(-2240.6, -100.01, 100.49), heading = 25.16, model = "prop_plant_01b"}, - { location = vector3(-2246.29, -104.92, 99.27), heading = 21.52, model = "prop_plant_01b"}, - { location = vector3(-2243.64, -107.99, 96.71), heading = 334.49, model = "prop_plant_01b"}, - { location = vector3(-2254.22, -108.76, 97.25), heading = 329.56, model = "prop_plant_01b"}, - { location = vector3(-2247.33, -108.92, 97.70), heading = 25.16, model = "prop_plant_01b"}, - { location = vector3(-2250.96, -111.22, 97.50), heading = 21.52, model = "prop_plant_01b"}, - { location = vector3(465.95, -1021.32, 31.78), heading = 21.52, model = "prop_plant_01b"}, -} - -Config.shrooms = { - { location = vector3(2185.14, 5183.81, 57.48), heading = 334.49, model = "mushroom"}, - { location = vector3(2174.45, 5187.85, 57.43), heading = 329.56, model = "mushroom"}, - { location = vector3(2166.22, 5196.56, 58.0), heading = 25.16, model = "mushroom"}, - { location = vector3(2166.82, 5204.83, 58.63), heading = 21.52, model = "mushroom"}, - { location = vector3(2174.84, 5205.82, 59.19), heading = 334.49, model = "mushroom"}, - { location = vector3(2184.46, 5201.23, 59.2), heading = 329.56, model = "mushroom"}, - { location = vector3(2192.45, 5194.89, 58.86), heading = 25.16, model = "mushroom"}, - { location = vector3(2207.53, 5187.81, 58.95), heading = 21.52, model = "mushroom"}, - { location = vector3(2213.46, 5191.11, 59.81), heading = 334.49, model = "mushroom"}, - { location = vector3(2218.31, 5180.0, 58.18), heading = 329.56, model = "mushroom"}, - { location = vector3(2212.75, 5172.35, 57.2), heading = 25.16, model = "mushroom"}, - { location = vector3(2208.56, 5167.06, 56.34), heading = 21.52, model = "mushroom"}, - { location = vector3(2196.9, 5158.59, 54.84), heading = 21.52, model = "mushroom"}, - { location = vector3(2191.62, 5174.91, 56.68), heading = 21.52, model = "mushroom"}, - { location = vector3(2190.18, 5182.54, 57.47), heading = 21.52, model = "mushroom"}, - { location = vector3(2185.85, 5190.49, 58.1), heading = 21.52, model = "mushroom"}, - { location = vector3(2179.95, 5194.19, 58.26), heading = 21.52, model = "mushroom"}, -} - -Config.Mescaline = { - { location = vector3(2598.73, 4207.89, 41.02), heading = 334.49, model = "prop_cactus_03"}, - { location = vector3(2601.46, 4199.34, 40.62), heading = 329.56, model = "prop_cactus_03"}, - { location = vector3(2611.63, 4194.18, 41.18), heading = 25.16, model = "prop_cactus_03"}, - { location = vector3(2620.18, 4202.69, 41.5), heading = 21.52, model = "prop_cactus_03"}, - { location = vector3(2624.26, 4211.75, 42.34), heading = 334.49, model = "prop_cactus_03"}, - { location = vector3(2635.21, 4207.5, 42.49), heading = 329.56, model = "prop_cactus_03"}, - { location = vector3(2644.97, 4193.51, 42.11), heading = 25.16, model = "prop_cactus_03"}, - { location = vector3(2654.21, 4195.31, 41.23), heading = 21.52, model = "prop_cactus_03"}, - { location = vector3(2653.32, 4206.49, 41.62), heading = 334.49, model = "prop_cactus_03"}, - { location = vector3(2647.45, 4213.94, 42.49), heading = 329.56, model = "prop_cactus_03"}, - { location = vector3(2636.3, 4218.49, 43.03), heading = 25.16, model = "prop_cactus_03"}, - { location = vector3(2627.37, 4223.2, 42.88), heading = 21.52, model = "prop_cactus_03"}, - { location = vector3(2617.86, 4230.38, 42.63), heading = 21.52, model = "prop_cactus_03"}, - { location = vector3(2609.8, 4222.12, 41.19), heading = 21.52, model = "prop_cactus_03"}, - { location = vector3(2602.96, 4194.05, 41.01), heading = 21.52, model = "prop_cactus_03"}, - { location = vector3(2614.39, 4188.3, 41.68), heading = 21.52, model = "prop_cactus_03"}, - { location = vector3(2623.82, 4189.97, 41.44), heading = 21.52, model = "prop_cactus_03"}, -} - +Config.MethHeist = false \ No newline at end of file From 5bc0e9f4e084c9d1d469b3c30d0b66077622ab14 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 12 Nov 2024 01:04:42 -0800 Subject: [PATCH 02/36] moved more --- client/animationsandfunctions.lua | 6 +- client/oxyruns.lua | 5 +- client/travellingmerchant.lua | 5 +- client/weed.lua | 2 +- server/cornerselling.lua | 147 +++++++++++++++++++++++++++--- server/deliveries.lua | 2 +- server/oxyruns.lua | 24 ++--- server/targets.lua | 100 +++++++++++++------- server/travellingmerchant.lua | 3 +- server/wholesale.lua | 18 +++- shared/config.lua | 72 +-------------- shared/qbdrugsrewrite.lua | 133 --------------------------- 12 files changed, 242 insertions(+), 275 deletions(-) diff --git a/client/animationsandfunctions.lua b/client/animationsandfunctions.lua index 521d52b..3365d58 100644 --- a/client/animationsandfunctions.lua +++ b/client/animationsandfunctions.lua @@ -373,7 +373,8 @@ end local hit = 0 function SpawnCarPedChase() local stoploc = vector3(-1157.63, -3056.71, 13.94) - local start = Config.StartLoc[math.random(1,#Config.StartLoc)] + local config = lib.callback.await('md-drugs:server:getLocs', false) + local start = config.StartLoc[math.random(1,#config.StartLoc)] if started then Notify(Lang.lean.act,'error') else @@ -434,7 +435,8 @@ end function SpawnMethCarPedChase() local ped = GetEntityCoords(PlayerPedId()) local stoploc = vector3(-1157.63, -3056.71, 13.94) -local start = Config.StartLoc[math.random(1,#Config.StartLoc)] +local config = lib.callback.await('md-drugs:server:getLocs', false) +local start = config.StartLoc[math.random(1,#config.StartLoc)] local startedmeth = false if startedmeth then diff --git a/client/oxyruns.lua b/client/oxyruns.lua index 9ad39a8..68e23c3 100644 --- a/client/oxyruns.lua +++ b/client/oxyruns.lua @@ -15,8 +15,9 @@ end) -RegisterNetEvent("md-drugs:client:getoxylocationroute", function() - local CurrentLocation = Config.oxylocations[math.random(#Config.oxylocations)] +RegisterNetEvent("md-drugs:client:getoxylocationroute", function() + local config = lib.callback.await('md-drugs:server:getLocs', false) + local CurrentLocation = config.oxylocations[math.random(#config.oxylocations)] if CurrentLocation ~= nil then SetNewWaypoint(CurrentLocation.x, CurrentLocation.y) local current = "g_m_y_famdnf_01" diff --git a/client/travellingmerchant.lua b/client/travellingmerchant.lua index d679f3a..45f698f 100644 --- a/client/travellingmerchant.lua +++ b/client/travellingmerchant.lua @@ -4,9 +4,8 @@ CreateThread(function() local current = "g_m_y_famdnf_01" lib.requestModel(current, Config.RequestModelTime) local num = lib.callback.await('md-drugs:server:GetMerchant', false) - local CurrentLocation = Config.Travellingmerchant[num] - local travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false) - Freeze(travellingmerchant, true, CurrentLocation.w) + local travellingmerchant = CreatePed(0, current,num.x,num.y,num.z-1, num.w, false, false) + Freeze(travellingmerchant, true, num.w) AddSingleModel(travellingmerchant, { label = Lang.targets.travel.travel, icon = "fas fa-eye", action = function() makeMenu('travellingMerchant') diff --git a/client/weed.lua b/client/weed.lua index b146111..1199399 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -57,7 +57,7 @@ end) CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) - AddBoxZoneMulti('weeddry', Config.WeedDry, { + AddBoxZoneMulti('weeddry', config.WeedDry, { name = 'dryweed', icon = "fas fa-sign-in-alt", label = Lang.targets.weed.dry, diff --git a/server/cornerselling.lua b/server/cornerselling.lua index 02ad356..87e9be7 100644 --- a/server/cornerselling.lua +++ b/server/cornerselling.lua @@ -1,18 +1,138 @@ local QBCore = exports['qb-core']:GetCoreObject() +local Drugs = { + ["weed_white-widow"] = {rep = 1,min = 15, max = 24 }, + ["weed_og-kush"] = {rep = 1,min = 15, max = 28 }, + ["weed_skunk"] = {rep = 1,min = 15, max = 31 }, + ["weed_amnesia"] = {rep = 1,min = 18, max = 34 }, + ["weed_purple-haze"] = {rep = 1,min = 18, max = 37}, + ["weed_ak47"] = {rep = 1,min = 18, max = 40}, + ["crack_baggy"] = {rep = 1,min = 18, max = 34}, + ["cokebaggy"] = {rep = 1,min = 18, max = 37}, + ["cokebaggystagetwo"] = {rep = 1,min = 18, max = 40}, + ["cokebaggystagethree"] = {rep = 1,min = 18, max = 40}, + ["heroin_ready"] = {rep = 1,min = 18, max = 40}, + ["heroin_readystagetwo"] = {rep = 1,min = 18, max = 40}, + ["heroin_readystagethree"] = {rep = 1,min = 18, max = 40}, + ["baggedcracked"] = {rep = 1,min = 18, max = 40}, + ["baggedcrackedstagetwo"] = {rep = 1,min = 18, max = 40}, + ["baggedcrackedstagethree"] = {rep = 1,min = 18, max = 40}, + ["white_playboys"] = {rep = 1,min = 18, max = 40}, + ["white_playboys2"] = {rep = 1,min = 18, max = 40}, + ["white_playboys3"] = {rep = 1,min = 18, max = 40}, + ["white_playboys4"] = {rep = 1,min = 18, max = 40}, + ["blue_playboys"] = {rep = 1,min = 18, max = 40}, + ["blue_playboys2"] = {rep = 1,min = 18, max = 40}, + ["blue_playboys3"] = {rep = 1,min = 18, max = 40}, + ["blue_playboys4"] = {rep = 1,min = 18, max = 40}, + ["red_playboys"] = {rep = 1,min = 18, max = 40}, + ["red_playboys2"] = {rep = 1,min = 18, max = 40}, + ["red_playboys3"] = {rep = 1,min = 18, max = 40}, + ["red_playboys4"] = {rep = 1,min = 18, max = 40}, + ["orange_playboys"] = {rep = 1,min = 18, max = 40}, + ["orange_playboys2"] = {rep = 1,min = 18, max = 40}, + ["orange_playboys3"] = {rep = 1,min = 18, max = 40}, + ["orange_playboys4"] = {rep = 1,min = 18, max = 40}, + ["white_aliens"] = {rep = 1,min = 18, max = 40}, + ["white_aliens2"] = {rep = 1,min = 18, max = 40}, + ["white_aliens3"] = {rep = 1,min = 18, max = 40}, + ["white_aliens4"] = {rep = 1,min = 18, max = 40}, + ["blue_aliens"] = {rep = 1,min = 18, max = 40}, + ["blue_aliens2"] = {rep = 1,min = 18, max = 40}, + ["blue_aliens3"] = {rep = 1,min = 18, max = 40}, + ["blue_aliens4"] = {rep = 1,min = 18, max = 40}, + ["red_aliens"] = {rep = 1,min = 18, max = 40}, + ["red_aliens2"] = {rep = 1,min = 18, max = 40}, + ["red_aliens3"] = {rep = 1,min = 18, max = 40}, + ["red_aliens4"] = {rep = 1,min = 18, max = 40}, + ["orange_aliens"] = {rep = 1,min = 18, max = 40}, + ["orange_aliens2"] = {rep = 1,min = 18, max = 40}, + ["orange_aliens3"] = {rep = 1,min = 18, max = 40}, + ["orange_aliens4"] = {rep = 1,min = 18, max = 40}, + ["white_pl"] = {rep = 1,min = 18, max = 40}, + ["white_pl2"] = {rep = 1,min = 18, max = 40}, + ["white_pl3"] = {rep = 1,min = 18, max = 40}, + ["white_pl4"] = {rep = 1,min = 18, max = 40}, + ["blue_pl"] = {rep = 1,min = 18, max = 40}, + ["blue_pl2"] = {rep = 1,min = 18, max = 40}, + ["blue_pl3"] = {rep = 1,min = 18, max = 40}, + ["blue_pl4"] = {rep = 1,min = 18, max = 40}, + ["red_pl"] = {rep = 1,min = 18, max = 40}, + ["red_pl2"] = {rep = 1,min = 18, max = 40}, + ["red_pl3"] = {rep = 1,min = 18, max = 40}, + ["red_pl4"] = {rep = 1,min = 18, max = 40}, + ["orange_pl"] = {rep = 1,min = 18, max = 40}, + ["orange_pl2"] = {rep = 1,min = 18, max = 40}, + ["orange_pl3"] = {rep = 1,min = 18, max = 40}, + ["orange_pl4"] = {rep = 1,min = 18, max = 40}, + ["white_trolls"] = {rep = 1,min = 18, max = 40}, + ["white_trolls2"] = {rep = 1,min = 18, max = 40}, + ["white_trolls3"] = {rep = 1,min = 18, max = 40}, + ["white_trolls4"] = {rep = 1,min = 18, max = 40}, + ["blue_trolls"] = {rep = 1,min = 18, max = 40}, + ["blue_trolls2"] = {rep = 1,min = 18, max = 40}, + ["blue_trolls3"] = {rep = 1,min = 18, max = 40}, + ["blue_trolls4"] = {rep = 1,min = 18, max = 40}, + ["red_trolls"] = {rep = 1,min = 18, max = 40}, + ["red_trolls2"] = {rep = 1,min = 18, max = 40}, + ["red_trolls3"] = {rep = 1,min = 18, max = 40}, + ["red_trolls4"] = {rep = 1,min = 18, max = 40}, + ["orange_trolls"] = {rep = 1,min = 18, max = 40}, + ["orange_trolls2"] = {rep = 1,min = 18, max = 40}, + ["orange_trolls3"] = {rep = 1,min = 18, max = 40}, + ["orange_trolls4"] = {rep = 1,min = 18, max = 40}, + ["white_cats"] = {rep = 1,min = 18, max = 40}, + ["white_cats2"] = {rep = 1,min = 18, max = 40}, + ["white_cats3"] = {rep = 1,min = 18, max = 40}, + ["white_cats4"] = {rep = 1,min = 18, max = 40}, + ["blue_cats"] = {rep = 1,min = 18, max = 40}, + ["blue_cats2"] = {rep = 1,min = 18, max = 40}, + ["blue_cats3"] = {rep = 1,min = 18, max = 40}, + ["blue_cats4"] = {rep = 1,min = 18, max = 40}, + ["red_cats"] = {rep = 1,min = 18, max = 40}, + ["red_cats2"] = {rep = 1,min = 18, max = 40}, + ["red_cats3"] = {rep = 1,min = 18, max = 40}, + ["red_cats4"] = {rep = 1,min = 18, max = 40}, + ["orange_cats"] = {rep = 1,min = 18, max = 40}, + ["orange_cats2"] = {rep = 1,min = 18, max = 40}, + ["orange_cats3"] = {rep = 1,min = 18, max = 40}, + ["orange_cats4"] = {rep = 1,min = 18, max = 40}, + ["blunts"] = {rep = 1,min = 18, max = 40}, + ["leanblunts"] = {rep = 1,min = 18, max = 40}, + ["dextroblunts"] = {rep = 1,min = 18, max = 40}, + ["chewyblunt"] = {rep = 1,min = 18, max = 40}, + ["blunt"] = {rep = 1,min = 18, max = 40}, + ["specialchocolate"] = {rep = 1,min = 18, max = 40}, + ["specialbrownie"] = {rep = 1,min = 18, max = 40}, + ["specialcookie"] = {rep = 1,min = 18, max = 40}, + ["specialmuffin"] = {rep = 1,min = 18, max = 40}, + ["shatter"] = {rep = 1,min = 18, max = 40}, + ["ciggie"] = {rep = 1,min = 18, max = 40}, + ["methbags"] = {rep = 1,min = 18, max = 40}, + ["driedmescaline"] = {rep = 1,min = 18, max = 40}, + ["shrooms"] = {rep = 1,min = 18, max = 40}, + ["gratefuldead_tabs"] = {rep = 1,min = 18, max = 40}, + ["bart_tabs"] = {rep = 1,min = 18, max = 40}, + ["pineapple_tabs"] = {rep = 1,min = 18, max = 40}, + ["yinyang_tabs"] = {rep = 1,min = 18, max = 40}, + ["wildcherry_tabs"] = {rep = 1,min = 18, max = 40}, + ["smiley_tabs"] = {rep = 1,min = 18, max = 40}, + ["cupoflean"] = {rep = 1,min = 18, max = 40}, + ["cupofdextro"] = {rep = 1,min = 18, max = 40}, +} lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, cb) local Player = getPlayer(source) local rep = getRep(source, 'cornerselling') if not Player then return nil end local type = 0 - for k, v in pairs(QBConfig.DrugsPrice) do + for k, v in pairs(Drugs) do local item = Player.Functions.GetItemByName(k) if item and type == 0 then type = type + 1 Log(GetName(source) .. ' Allowed To Sell ' .. item.name .. '!' , 'cornerselling') local amount = math.random(1,item.amount) if amount >= 15 then amount = 15 end - local price = math.random(QBConfig.DrugsPrice[k]['min'], QBConfig.DrugsPrice[k]['max']) * amount + local price = math.random(Drugs[k]['min'], Drugs[k]['max']) * amount local result = math.floor(price * rep.price) return item.name, amount, result end @@ -26,22 +146,27 @@ end) RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price) local src = source local Player = getPlayer(src) + local isIn = false + for k, v in pairs (Drugs) do + if item == k then + isIn = true + end + end + if not isIn then return end if RemoveItem(src, item, amount) then - AddRep(src, 'cornerselling', QBConfig.DrugsPrice[item].rep * amount) - Log(GetName(src) .. ' Sold ' .. amount .. ' Of ' .. item .. ' For A Price Of ' .. price .. '!' , 'cornerselling') if QBConfig.MarkedBills then - if price >= QBConfig.DrugsPrice[item]['min'] * amount and price <= QBConfig.DrugsPrice[item]['max'] * amount then - local info = { - worth = price - } - Player.Functions.AddItem('markedbills', 1, false, info ) - end + local info = { + worth = price + } + Player.Functions.AddItem('markedbills', 1, false, info ) elseif QBConfig.CustomDirtyMoney then AddItem(src, QBConfig.CustomDirtyMoneyitem, price) else Player.Functions.AddMoney('cash', price) end - end + AddRep(src, 'cornerselling', Drugs[item].rep * amount) + Log(GetName(src) .. ' Sold ' .. amount .. ' Of ' .. item .. ' For A Price Of ' .. price .. '!' , 'cornerselling') + end end) lib.addCommand('cornersell', { diff --git a/server/deliveries.lua b/server/deliveries.lua index 6f17ca4..c1fbeb5 100644 --- a/server/deliveries.lua +++ b/server/deliveries.lua @@ -14,7 +14,7 @@ lib.callback.register('md-drugs:server:getDealers', function(data) return check end end) - + lib.callback.register('md-drugs:server:GetDeliveryItem', function(data) local src = source diff --git a/server/oxyruns.lua b/server/oxyruns.lua index 283c520..4dbff99 100644 --- a/server/oxyruns.lua +++ b/server/oxyruns.lua @@ -3,7 +3,7 @@ QBCore = exports['qb-core']:GetCoreObject() lib.callback.register('md-drugs:server:payfortruck', function() local src = source local Player = getPlayer(src) - if Player.Functions.RemoveMoney('cash', Config.TruckPrice ) or Player.Functions.RemoveMoney('bank', Config.TruckPrice ) then + if Player.Functions.RemoveMoney('cash', 500) or Player.Functions.RemoveMoney('bank', 500) then Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy') return true else @@ -17,24 +17,26 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function() local src = source local Player = getPlayer(src) local chance = math.random(1,100) - local cash = Config.OxyRunCompleteCash + local cash = 200 local itemchance = math.random(1,100) - local item = Config.OxyRandItems[math.random(1, #Config.OxyRandItems)] - - if chance <= Config.OxyRunDitchChance then + local itemList = { + {item = 'oxy', amount = 2}, + {item = 'lockpick', amount = 1}, + {item = 'cryptostick', amount = 1}, + } + local item = itemList[math.random(1, #itemList)] + if chance <= 30 then Notifys(src, Lang.oxy.hot, "error") Player.Functions.AddMoney("cash", cash * 0.5) - if itemchance <= Config.OxyItemChance then - AddItem(src, item, Config.OxyItemAmount) - Log(GetName(source) .. ' Got ' .. Config.OxyItemAmount .. ' Of ' .. item .. ' For This Drop Off', 'oxy') + if itemchance <= 30 then + AddItem(src, item.item, item.amount) end else Notifys(Lang.oxy.next, "success") TriggerClientEvent("md-drugs:client:getoxylocationroute", src) Player.Functions.AddMoney("cash", cash) - if itemchance <= Config.OxyItemChance then - AddItem(src, item, Config.OxyItemAmount) - Log(GetName(source) .. ' Got ' .. Config.OxyItemAmount .. ' Of ' .. item .. ' For This Drop Off', 'oxy') + if itemchance <= 30 then + AddItem(src, item.item, item.amount) end end diff --git a/server/targets.lua b/server/targets.lua index f5e6676..596fe59 100644 --- a/server/targets.lua +++ b/server/targets.lua @@ -1,83 +1,113 @@ local Target = { - MakePowder = { + 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(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 = ""}, }, - CuttingCoke = { + 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 = ""}, }, - BaggingCoke = { + BaggingCoke = { -- only active if Config.FancyCokeAnims = false {loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - makecrack = { + makecrack = { -- make crack with baking soda with cut coke 1-3 {loc = vector3(2434.07, 4969.39, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - bagcrack = { + bagcrack = { --- bag crack 1-3 stages {loc = vector3(2435.85, 4965.3, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - lysergicacid = { + lysergicacid = { -- get lysergic acid {loc = vector3(-1381.21, -327.75, 39.85), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(2405.53, 5008.39, 46.02), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - diethylamide = { + diethylamide = { -- get diethylamide {loc = vector3(-1371.71, -316.02, 39.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(2408.38, 5011.18, 46.08), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - gettabs = { + gettabs = { -- buy tab paper {loc = vector3(-1370.77, -314.51, 39.58), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(2409.59, 5012.45, 46.09), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - dryplant = { + dryplant = { -- turn resin into powder {loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - cutheroinone = { + cutheroinone = { -- cut heroin stage 1-3 with baking soda {loc = vector3(-1360.14, -337.03, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - fillneedle = { + fillneedle = { -- fill needles with heroin {loc = vector3(-1366.32, -334.40, 44.44), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - isosafrole = { + isosafrole = { -- where to steal isosafrole {loc = vector3(844.39, -902.92, 25.42), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - mdp2p = { + mdp2p = { -- where to steal mdp2p {loc = vector3(844.4, -898.79, 25.23), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - rawxtcloc = { + rawxtcloc = { -- where to combine the 2 ingridents to make raw xtc {loc = vector3(844.71, -910.33, 25.37), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - stamp = { + stamp = { -- where to stamp pills {loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - FillPrescription = { + FillPrescription = { -- where to fill out your prescription {loc = vector3(2432.89, 4252.2, 36.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, singleSpot = { cutcoke = vector3(1093.17, -3195.74, -39.19), bagcokepowder = vector3(1090.29, -3195.66, -39.13), - CokeTeleIn = vector3(198.16, -1276.92, 29.33), - CokeTeleOut = vector3(1088.81, -3187.57, -38.99), - buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), - buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13), - buypress = vector3(845.82, -884.79, 25.18), - DryOut = vector3(2638.22, 4237.93, 44.78), - SyrupVendor = vector4(365.21, -578.77, 39.30, 347.23), - weedTelein = vector3(244.74, 374.54, 105.74), - weedTeleout = vector3(1066.31, -3183.36, -39.16), - MakeButter = vector3(1045.48, -3198.49, -38.22), - MakeOil = vector3(1038.90, -3198.66, -38.17), - WeedSaleman = vector4(1030.77, -3203.18, -38.2, 262.37), - MethTeleIn = vector3(-2222.04, 303.99, 174.6), - MethTeleOut = vector3(996.91, -3200.83, -36.39), - MethHeistStart = vector3(-1102.93, -3066.76, 14.00), - truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95), - Payfortruck = vector3(1437.64, -1491.91, 63.62) + 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 + buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), -- buy lab kit for lsd + buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13), -- buy lab kit for heroin + buypress = vector3(845.82, -884.79, 25.18), -- buy lab kit for xtc + DryOut = vector3(2638.22, 4237.93, 44.78), -- Place to dry out mescaline into usuable drug + SyrupVendor = vector4(365.21, -578.77, 39.30, 347.23), -- where the mission ped starts + weedTelein = vector3(244.74, 374.54, 105.74), -- where you target to tele in + weedTeleout = vector3(1066.31, -3183.36, -39.16), -- where you target to tele out + MakeButter = vector3(1045.48, -3198.49, -38.22), -- where you make cannabutter and baked edibles + MakeOil = vector3(1038.90, -3198.66, -38.17), -- where you make shatter + WeedSaleman = vector4(1030.77, -3203.18, -38.2, 262.37), -- where the weed saleman is + MethTeleIn = vector3(-2222.04, 303.99, 174.6), -- where you target to tele in meth + MethTeleOut = vector3(996.91, -3200.83, -36.39), -- where you target to tele out meth + MethHeistStart = vector3(-1102.93, -3066.76, 14.00), -- where you get the mission to get ingridients if meth heist = true + truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95), --- where the truck will spawn when you pay for it + Payfortruck = vector3(1437.64, -1491.91, 63.62), --- where you pay for the truck }, - MethEph = { + MethEph = { -- get ephedrine {loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, - Methace = { + Methace = { -- get acetone {loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + }, + StartLoc = { -- where truck spawns for lean and meth missions + vector3(-2307.22, 434.77, 174.47), + vector3(614.75, 1786.26, 199.39), + vector3(-224.89, 6388.32, 31.59) + }, + WeedDry = { + {loc = vector3(1043.0, -3191.59, -38.39),}, + {loc = vector3(1041.0, -3191.59, -38.39),}, + {loc = vector3(1045.0, -3191.59, -38.39),}, + {loc = vector3(1039.0, -3191.59, -38.39),}, + }, + Travellingmerchant = { -- where the travelling merchant can spawn + vector4(-119.66, -977.43, 304.25, 88.21), + vector4(-1522.93, 1476.01, 111.45, 41.25), + vector4(-3278.98, 973.38, 5.35, 101.53), + }, + oxylocations = { + vector4(-2352.32, 266.78, 165.3, 23.46), + vector4(-1467.49, 874.01, 183.59, 298.45), + vector4(-856.71, 874.26, 202.85, 205.3), + vector4(950.58, -128.49, 74.42, 205.3), + vector4(1152.71, -328.43, 69.21, 205.3), + vector4(112.66, -1955.67, 20.75, 37.94), + vector4(-544.4, -1684.8, 19.89, 252.07), + vector4(-1185.02, -1805.4, 3.91, 184.83), + vector4(-1641.4, -981.99, 7.58, 35.38), + vector4(-1827.93, 782.36, 138.29, 219.99), + vector4(-320.84, 2818.73, 59.45, 337.22), + vector4(474.88, 2609.56, 44.48, 357.0), } } diff --git a/server/travellingmerchant.lua b/server/travellingmerchant.lua index 427d561..78d3ba5 100644 --- a/server/travellingmerchant.lua +++ b/server/travellingmerchant.lua @@ -1,5 +1,6 @@ local QBCore = exports['qb-core']:GetCoreObject() -local loc = math.random(1, #Config.Travellingmerchant) +local config = lib.callback.await('md-drugs:server:getLocs', false) +local loc = config.Travellingmerchant[math.random(1, #config.Travellingmerchant)] local stores = { travel = { {name = "tab_paper", price = 50, amount = 50, }, diff --git a/server/wholesale.lua b/server/wholesale.lua index 21961f3..59c3f9e 100644 --- a/server/wholesale.lua +++ b/server/wholesale.lua @@ -5,6 +5,14 @@ local lsd = {'smiley_tabs', 'yinyang_tabs', 'wildcherry_tabs', 'pineapple_tabs', local heroin = {'heroin_ready', 'heroin_readystagetwo', 'heroin_readystagethree'} local xtc = {"white_playboys", "white_playboys2", "white_playboys3", "white_playboys4", "blue_playboys", "blue_playboys2", "blue_playboys3", "blue_playboys4", "red_playboys", "red_playboys2", "red_playboys3", "red_playboys4", "orange_playboys", "orange_playboy2s", "orange_playboys3", "orange_playboys4", "white_aliens", "white_aliens2", "white_aliens3", "white_aliens4", "blue_aliens", "blue_aliens2", "blue_aliens3", "blue_aliens4", "red_aliens", "red_aliens3", "red_aliens2", "red_aliens4", "orange_aliens", "orange_aliens2", "orange_aliens3", "orange_aliens4", "white_pl", "white_pl2", "white_pl3", "white_pl4", "blue_pl", "blue_pl2", "blue_pl3", "blue_pl4", "red_pl", "red_pl2", "red_pl3", "red_pl4", "orange_pl", "orange_pl2", "orange_pl3", "orange_pl4", "white_trolls", "white_trolls2", "white_trolls3", "white_trolls4", "blue_trolls", "blue_trolls2", "blue_trolls3", "blue_trolls4", "red_trolls", "red_trolls2", "red_trolls3", "red_trolls4", "orange_trolls", "orange_trolls2", "orange_trolls3", "orange_trolls4", "white_cats2", "white_cats3", "white_cats4", "white_cats", "blue_cats", "blue_cats3", "blue_cats2", "blue_cats4", "red_cats", "red_cats2", "red_cats3", "red_cats4", "orange_cats", "orange_cats2", "orange_cats3", "orange_cats4" } +local Price = { + coke = {min = 20, max = 60}, + crack = {min = 20, max = 60}, + lsd = {min = 20, max = 60}, + heroin = {min = 20, max = 60}, + xtc = {min = 20, max = 60}, + +} QBCore.Functions.CreateUseableItem("cokeburner", function(source, item) local src = source local Player = getPlayer(source) @@ -14,7 +22,7 @@ end) RegisterServerEvent('md-drugs:server:wholesalecoke', function() local src = source local Player = getPlayer(src) - local price = math.random(Config.Wcoke.min, Config.Wcoke.max) + local price = math.random(Price['coke'].min, Price['coke'].max) for k, v in pairs(coke) do local item = Player.Functions.GetItemByName(v) @@ -36,7 +44,7 @@ end) RegisterServerEvent('md-drugs:server:wholesalecrack', function() local src = source local Player = getPlayer(src) - local price = math.random(Config.Wcrack.min, Config.Wcrack.max) + local price = math.random(Price['crack'].min, Price['crack'].max) for k, v in pairs(crack) do local item = Player.Functions.GetItemByName(v) if item and item.amount > 0 then @@ -58,7 +66,7 @@ end) RegisterServerEvent('md-drugs:server:wholesalelsd', function() local src = source local Player = getPlayer(src) - local price = math.random(Config.Wlsd.min, Config.Wlsd.max) + local price = math.random(Price['lsd'].min, Price['lsd'].max) for k, v in pairs(lsd) do local item = Player.Functions.GetItemByName(v) @@ -82,7 +90,7 @@ end) RegisterServerEvent('md-drugs:server:wholesaleheroin', function() local src = source local Player = getPlayer(src) - local price = math.random(Config.WHeroin.min, Config.WHeroin.max) + local price = math.random(Price['heroin'].min, Price['heroin'].max) for k, v in pairs(heroin) do local item = Player.Functions.GetItemByName(v) @@ -104,7 +112,7 @@ end) RegisterServerEvent('md-drugs:server:wholesalextc', function() local src = source local Player = getPlayer(src) - local price = math.random(Config.WXTC.min, Config.WXTC.max) + local price = math.random(Price['xtc'].min, Price['xtc'].max) for k, v in pairs(xtc) do local item = Player.Functions.GetItemByName(v) diff --git a/shared/config.lua b/shared/config.lua index 64f3f57..d2127f5 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -34,90 +34,22 @@ Config.Minigames = { glpath = {gridSize = 19, lives = 3, timelimit = 10000}, glspot = {gridSize = 6, timeLimit = 999999, charSet = "alphabet", required = 10}, glmath = {timeLimit = 300000}, - } + Config.minigametype = 'ox' -- look above for options or choose none if you dont want any minigames -------------- you can either set a gang or leave it blank, if blank it will autopopulate data to not require it :) ----- ---- -------------- Cocaine -- new animations require to be in a certain spot or they get fucky. uses bob74 ipl if you turn Config.FancyCokeAnims you can put it anywhere :) + Config.FancyCokeAnims = false -- if you want multi location this needs to be false Config.tabcost = 100 -- price per piece of tab paper event does 10 at a time Config.lsdlabkitcost = 10000 -- price of the lsd lab kit Config.heroinlabkitprice = 10000 -- price of the lsd lab kit Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline --------------- lean - -Config.StartLoc = { - vector3(-2307.22, 434.77, 174.47), -- where the truck spawns - vector3(614.75, 1786.26, 199.39), - vector3(-224.89, 6388.32, 31.59) -} - ----------- Pharma Config.PharmaJob = "ems" -- what TYPE role you need to be on to get the command - --------------- weed -Config.WeedDry = { -- where you dry leaves - {loc = vector3(1043.0, -3191.59, -38.39),}, - {loc = vector3(1041.0, -3191.59, -38.39),}, - {loc = vector3(1045.0, -3191.59, -38.39),}, - {loc = vector3(1039.0, -3191.59, -38.39),}, -} - Config.Joblock = false -- if you want weed to be a job Config.weedjob = "" -- what the job name is ------------------ Wholesale Config.SuccessfulChance = 90 --- this is the chance of a Success wholesale 1-100 Config.AlertPoliceWholesale = 90 -- 1-100 of how often it will alert police Config.WholesaleTimeout = 600 -- time in seconds to get to the location Config.PoliceCount = 0 -- Amount of police required -Config.Wcoke = { min = 20, max = 60} -- pricings per item -Config.Wcrack = { min = 20, max = 60} -- pricings per item -Config.Wlsd = { min = 20, max = 60} -- pricings per item -Config.WXTC = { min = 20, max = 60} -- pricings per item - - ---- travelling merchant - -Config.Travellingmerchant = { ------------ these are the random locations the merchant can spawn on script start. whatever you want for the merchant is in Config.Items right below - vector4(-119.66, -977.43, 304.25, 88.21), - vector4(-1522.93, 1476.01, 111.45, 41.25), - vector4(-3278.98, 973.38, 5.35, 101.53), -} - ---------------------------------------- oxy runs ----- How oxyruns work. You pay for a truck, you get in it and it gives a route. There is a 20% chance that the car will be "hot" and you have to ditch it. No Routes will spawn if that pops up ------ when you get to the drop off point third eye the truck. You will carry a box to the ped. He will give you cash, some oxy and maybe a random item. Rinse and repeat -Config.TruckPrice = 500 -- amount the truck will cost to rent -Config.OxyRunCompleteCash = 200 -- base price you get for completeing a run. 50% if the car needs to be ditched -Config.OxyRunDitchChance = 20 -- % of a fail mission and having to ditch the car and not get a new order -Config.OxyItemChance = 50 -- chance to recieve an item from the OxyRandItems list below -Config.OxyItemAmount = 1 -- amount of the item you recieve when you get an item from OxyRandItems Config.PoliceAlertOxy = 90 -- This is a % out of 100 to alert police - -Config.oxylocations = { -- These are different locations where a ped spawns. - vector4(-2352.32, 266.78, 165.3, 23.46), - vector4(-1467.49, 874.01, 183.59, 298.45), - vector4(-856.71, 874.26, 202.85, 205.3), - vector4(950.58, -128.49, 74.42, 205.3), - vector4(1152.71, -328.43, 69.21, 205.3), - vector4(112.66, -1955.67, 20.75, 37.94), - vector4(-544.4, -1684.8, 19.89, 252.07), - vector4(-1185.02, -1805.4, 3.91, 184.83), - vector4(-1641.4, -981.99, 7.58, 35.38), - vector4(-1827.93, 782.36, 138.29, 219.99), - vector4(-320.84, 2818.73, 59.45, 337.22), - vector4(474.88, 2609.56, 44.48, 357.0), -} - -Config.OxyRandItems = { -- random items you get for completing the mission - "oxy", - "lockpick", - "cryptostick", -} - - ----------------------- Meth Config Config.MethHeist = false \ No newline at end of file diff --git a/shared/qbdrugsrewrite.lua b/shared/qbdrugsrewrite.lua index cc0e6dc..057c38d 100644 --- a/shared/qbdrugsrewrite.lua +++ b/shared/qbdrugsrewrite.lua @@ -7,139 +7,6 @@ QBConfig.MinimumDrugSalePolice = 0 QBConfig.MarkedBills = true -- if false on both options below then it auto converts selling to give cash QBConfig.CustomDirtyMoney = false QBConfig.CustomDirtyMoneyitem = '' - -QBConfig.DrugsPrice = { - -- base qb - ["weed_white-widow"] = {rep = 1,min = 15, max = 24 }, - ["weed_og-kush"] = {rep = 1,min = 15, max = 28 }, - ["weed_skunk"] = {rep = 1,min = 15, max = 31 }, - ["weed_amnesia"] = {rep = 1,min = 18, max = 34 }, - ["weed_purple-haze"] = {rep = 1,min = 18, max = 37}, - ["weed_ak47"] = {rep = 1,min = 18, max = 40}, - ["crack_baggy"] = {rep = 1,min = 18, max = 34}, - ["cokebaggy"] = {rep = 1,min = 18, max = 37}, - -- cokerep = 1, - ["cokebaggystagetwo"] = {rep = 1,min = 18, max = 40}, - ["cokebaggystagethree"] = {rep = 1,min = 18, max = 40}, - -- heroin rep = 1, - ["heroin_ready"] = {rep = 1,min = 18, max = 40}, - ["heroin_readystagetwo"] = {rep = 1,min = 18, max = 40}, - ["heroin_readystagethree"] = {rep = 1,min = 18, max = 40}, - -- crackrep = 1, - ["baggedcracked"] = {rep = 1,min = 18, max = 40}, - ["baggedcrackedstagetwo"] = {rep = 1,min = 18, max = 40}, - ["baggedcrackedstagethree"] = {rep = 1,min = 18, max = 40}, - -- xtc rep = 1, - ["white_playboys"] = {rep = 1,min = 18, max = 40}, - ["white_playboys2"] = {rep = 1,min = 18, max = 40}, - ["white_playboys3"] = {rep = 1,min = 18, max = 40}, - ["white_playboys4"] = {rep = 1,min = 18, max = 40}, - ["blue_playboys"] = {rep = 1,min = 18, max = 40}, - ["blue_playboys2"] = {rep = 1,min = 18, max = 40}, - ["blue_playboys3"] = {rep = 1,min = 18, max = 40}, - ["blue_playboys4"] = {rep = 1,min = 18, max = 40}, - ["red_playboys"] = {rep = 1,min = 18, max = 40}, - ["red_playboys2"] = {rep = 1,min = 18, max = 40}, - ["red_playboys3"] = {rep = 1,min = 18, max = 40}, - ["red_playboys4"] = {rep = 1,min = 18, max = 40}, - ["orange_playboys"] = {rep = 1,min = 18, max = 40}, - ["orange_playboys2"] = {rep = 1,min = 18, max = 40}, - ["orange_playboys3"] = {rep = 1,min = 18, max = 40}, - ["orange_playboys4"] = {rep = 1,min = 18, max = 40}, - ["white_aliens"] = {rep = 1,min = 18, max = 40}, - ["white_aliens2"] = {rep = 1,min = 18, max = 40}, - ["white_aliens3"] = {rep = 1,min = 18, max = 40}, - ["white_aliens4"] = {rep = 1,min = 18, max = 40}, - ["blue_aliens"] = {rep = 1,min = 18, max = 40}, - ["blue_aliens2"] = {rep = 1,min = 18, max = 40}, - ["blue_aliens3"] = {rep = 1,min = 18, max = 40}, - ["blue_aliens4"] = {rep = 1,min = 18, max = 40}, - ["red_aliens"] = {rep = 1,min = 18, max = 40}, - ["red_aliens2"] = {rep = 1,min = 18, max = 40}, - ["red_aliens3"] = {rep = 1,min = 18, max = 40}, - ["red_aliens4"] = {rep = 1,min = 18, max = 40}, - ["orange_aliens"] = {rep = 1,min = 18, max = 40}, - ["orange_aliens2"] = {rep = 1,min = 18, max = 40}, - ["orange_aliens3"] = {rep = 1,min = 18, max = 40}, - ["orange_aliens4"] = {rep = 1,min = 18, max = 40}, - ["white_pl"] = {rep = 1,min = 18, max = 40}, - ["white_pl2"] = {rep = 1,min = 18, max = 40}, - ["white_pl3"] = {rep = 1,min = 18, max = 40}, - ["white_pl4"] = {rep = 1,min = 18, max = 40}, - ["blue_pl"] = {rep = 1,min = 18, max = 40}, - ["blue_pl2"] = {rep = 1,min = 18, max = 40}, - ["blue_pl3"] = {rep = 1,min = 18, max = 40}, - ["blue_pl4"] = {rep = 1,min = 18, max = 40}, - ["red_pl"] = {rep = 1,min = 18, max = 40}, - ["red_pl2"] = {rep = 1,min = 18, max = 40}, - ["red_pl3"] = {rep = 1,min = 18, max = 40}, - ["red_pl4"] = {rep = 1,min = 18, max = 40}, - ["orange_pl"] = {rep = 1,min = 18, max = 40}, - ["orange_pl2"] = {rep = 1,min = 18, max = 40}, - ["orange_pl3"] = {rep = 1,min = 18, max = 40}, - ["orange_pl4"] = {rep = 1,min = 18, max = 40}, - ["white_trolls"] = {rep = 1,min = 18, max = 40}, - ["white_trolls2"] = {rep = 1,min = 18, max = 40}, - ["white_trolls3"] = {rep = 1,min = 18, max = 40}, - ["white_trolls4"] = {rep = 1,min = 18, max = 40}, - ["blue_trolls"] = {rep = 1,min = 18, max = 40}, - ["blue_trolls2"] = {rep = 1,min = 18, max = 40}, - ["blue_trolls3"] = {rep = 1,min = 18, max = 40}, - ["blue_trolls4"] = {rep = 1,min = 18, max = 40}, - ["red_trolls"] = {rep = 1,min = 18, max = 40}, - ["red_trolls2"] = {rep = 1,min = 18, max = 40}, - ["red_trolls3"] = {rep = 1,min = 18, max = 40}, - ["red_trolls4"] = {rep = 1,min = 18, max = 40}, - ["orange_trolls"] = {rep = 1,min = 18, max = 40}, - ["orange_trolls2"] = {rep = 1,min = 18, max = 40}, - ["orange_trolls3"] = {rep = 1,min = 18, max = 40}, - ["orange_trolls4"] = {rep = 1,min = 18, max = 40}, - ["white_cats"] = {rep = 1,min = 18, max = 40}, - ["white_cats2"] = {rep = 1,min = 18, max = 40}, - ["white_cats3"] = {rep = 1,min = 18, max = 40}, - ["white_cats4"] = {rep = 1,min = 18, max = 40}, - ["blue_cats"] = {rep = 1,min = 18, max = 40}, - ["blue_cats2"] = {rep = 1,min = 18, max = 40}, - ["blue_cats3"] = {rep = 1,min = 18, max = 40}, - ["blue_cats4"] = {rep = 1,min = 18, max = 40}, - ["red_cats"] = {rep = 1,min = 18, max = 40}, - ["red_cats2"] = {rep = 1,min = 18, max = 40}, - ["red_cats3"] = {rep = 1,min = 18, max = 40}, - ["red_cats4"] = {rep = 1,min = 18, max = 40}, - ["orange_cats"] = {rep = 1,min = 18, max = 40}, - ["orange_cats2"] = {rep = 1,min = 18, max = 40}, - ["orange_cats3"] = {rep = 1,min = 18, max = 40}, - ["orange_cats4"] = {rep = 1,min = 18, max = 40}, - -- weed stuffrep = 1, - ["blunts"] = {rep = 1,min = 18, max = 40}, - ["leanblunts"] = {rep = 1,min = 18, max = 40}, - ["dextroblunts"] = {rep = 1,min = 18, max = 40}, - ["chewyblunt"] = {rep = 1,min = 18, max = 40}, - ["blunt"] = {rep = 1,min = 18, max = 40}, - ["specialchocolate"] = {rep = 1,min = 18, max = 40}, - ["specialbrownie"] = {rep = 1,min = 18, max = 40}, - ["specialcookie"] = {rep = 1,min = 18, max = 40}, - ["specialmuffin"] = {rep = 1,min = 18, max = 40}, - ["shatter"] = {rep = 1,min = 18, max = 40}, - ["ciggie"] = {rep = 1,min = 18, max = 40}, - -- methrep = 1, - ["methbags"] = {rep = 1,min = 18, max = 40}, - -- mescalinerep = 1, - ["driedmescaline"] = {rep = 1,min = 18, max = 40}, - -- shroomsrep = 1, - ["shrooms"] = {rep = 1,min = 18, max = 40}, - -- LSDrep = 1, - ["gratefuldead_tabs"] = {rep = 1,min = 18, max = 40}, - ["bart_tabs"] = {rep = 1,min = 18, max = 40}, - ["pineapple_tabs"] = {rep = 1,min = 18, max = 40}, - ["yinyang_tabs"] = {rep = 1,min = 18, max = 40}, - ["wildcherry_tabs"] = {rep = 1,min = 18, max = 40}, - ["smiley_tabs"] = {rep = 1,min = 18, max = 40}, - -- lean - ["cupoflean"] = {rep = 1,min = 18, max = 40}, - ["cupofdextro"] = {rep = 1,min = 18, max = 40}, -} - QBConfig.Dealers = {} QBConfig.DeliveryItems = { From 31ee7f88c01707f72095299f687a4b2a2d38f00c Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 12 Nov 2024 01:06:40 -0800 Subject: [PATCH 03/36] update file names --- server/{targets.lua => locations.lua} | 0 server/{travellingmerchant.lua => shops.lua} | 168 +++++++++---------- 2 files changed, 84 insertions(+), 84 deletions(-) rename server/{targets.lua => locations.lua} (100%) rename server/{travellingmerchant.lua => shops.lua} (97%) diff --git a/server/targets.lua b/server/locations.lua similarity index 100% rename from server/targets.lua rename to server/locations.lua diff --git a/server/travellingmerchant.lua b/server/shops.lua similarity index 97% rename from server/travellingmerchant.lua rename to server/shops.lua index 78d3ba5..0f1478f 100644 --- a/server/travellingmerchant.lua +++ b/server/shops.lua @@ -1,85 +1,85 @@ -local QBCore = exports['qb-core']:GetCoreObject() -local config = lib.callback.await('md-drugs:server:getLocs', false) -local loc = config.Travellingmerchant[math.random(1, #config.Travellingmerchant)] -local stores = { - travel = { - {name = "tab_paper", price = 50, amount = 50, }, - {name = "bakingsoda", price = 25, amount = 50, }, - {name = "isosafrole", price = 25, amount = 50, }, - {name = "mdp2p", price = 25, amount = 50, }, - {name = "lysergic_acid", price = 25, amount = 50, }, - {name = "diethylamide", price = 25, amount = 50, }, - {name = "lockpick", price = 2, amount = 1000, }, - {name = "emptyvial", price = 2, amount = 1000, }, - {name = "needle", price = 2, amount = 1000, }, - {name = "cokeburner", price = 25, amount = 50, }, - {name = "crackburner", price = 2, amount = 50, }, - {name = "lsdburner", price = 2, amount = 50, }, - {name = "heroinburner", price = 2, amount = 50, }, - {name = "mdlean", price = 50, amount = 50, }, - {name = "weedgrinder", price = 25, amount = 50, }, - {name = "mdbutter", price = 25, amount = 50, }, - {name = "flour", price = 25, amount = 50, }, - {name = "chocolate", price = 25, amount = 50, }, - {name = "butane", price = 25, amount = 50, }, - {name = "butanetorch", price = 2, amount = 1000, }, - {name = "dabrig", price = 2, amount = 1000, }, - {name = "mdwoods", price = 2, amount = 1000, }, - {name = "leancup", price = 25, amount = 50, }, - {name = "xtcburner", price = 25, amount = 50, }, - }, - Weed = { - {name = "weedgrinder", price = 25, amount = 50, }, - {name = "mdbutter", price = 25, amount = 50, }, - {name = "flour", price = 25, amount = 50, }, - {name = "chocolate", price = 25, amount = 50, }, - {name = "butane", price = 25, amount = 50, }, - {name = "butanetorch", price = 2, amount = 1000,}, - {name = "dabrig", price = 2, amount = 1000,}, - {name = "mdwoods", price = 2, amount = 1000}, - }, - Products = { - {name = "weed_white-widow_seed", price = 15, amount = 150, minrep = 0}, - {name = "weed_skunk_seed", price = 15, amount = 150, minrep = 0}, - {name = "weed_purple-haze_seed", price = 15, amount = 150, minrep = 0}, - {name = "weed_og-kush_seed", price = 15, amount = 150, minrep = 0}, - {name = "weed_amnesia_seed", price = 15, amount = 150, minrep = 0}, - }, - ProductsStupidNameRewrite = { - {name = "weed_whitewidow_seed", price = 15, amount = 150, minrep = 0}, - {name = "weed_skunk_seed", price = 15, amount = 150, minrep = 0}, - {name = "weed_purplehaze_seed", price = 15, amount = 150, minrep = 0}, - {name = "weed_ogkush_seed", price = 15, amount = 150, minrep = 0}, - {name = "weed_amnesia_seed", price = 15, amount = 150, minrep = 0}, - } -} - -lib.callback.register('md-drugs:server:menu', function(source, data) - local src = source - if data == 'travellingMerchant' then - return {table = stores.travel, des = '$', id = 'travellingMerchant', title = 'travelling Merchant'} - elseif data == 'dealermenu' then - local table - if Config.StupidassNewQbItemName then table = stores.ProductsStupidNameRewrite else table = stores.Products end - return {table = table, id = 'dealermenu', title = "Dealer Menu"} - elseif data == 'WeedShop' then - return {table = stores.Weed, id = 'WeedShop', title = "Weed Shop"} - end -end) - -RegisterServerEvent("md-drugs:server:purchaseGoods", function(amount, money, item, price,table,num) - local src = source local Player = getPlayer(src) - for i = 1, #table do - if table[i].name == item then - if not table[i].price == price then return end - if Player.Functions.RemoveMoney(tostring(money), tonumber(table[i].price) * tonumber(amount)) then - AddItem(src, item, amount) - Log(GetName(src) .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant') - end - end - end -end) - -lib.callback.register('md-drugs:server:GetMerchant', function(source) - return loc +local QBCore = exports['qb-core']:GetCoreObject() +local config = lib.callback.await('md-drugs:server:getLocs', false) +local loc = config.Travellingmerchant[math.random(1, #config.Travellingmerchant)] +local stores = { + travel = { + {name = "tab_paper", price = 50, amount = 50, }, + {name = "bakingsoda", price = 25, amount = 50, }, + {name = "isosafrole", price = 25, amount = 50, }, + {name = "mdp2p", price = 25, amount = 50, }, + {name = "lysergic_acid", price = 25, amount = 50, }, + {name = "diethylamide", price = 25, amount = 50, }, + {name = "lockpick", price = 2, amount = 1000, }, + {name = "emptyvial", price = 2, amount = 1000, }, + {name = "needle", price = 2, amount = 1000, }, + {name = "cokeburner", price = 25, amount = 50, }, + {name = "crackburner", price = 2, amount = 50, }, + {name = "lsdburner", price = 2, amount = 50, }, + {name = "heroinburner", price = 2, amount = 50, }, + {name = "mdlean", price = 50, amount = 50, }, + {name = "weedgrinder", price = 25, amount = 50, }, + {name = "mdbutter", price = 25, amount = 50, }, + {name = "flour", price = 25, amount = 50, }, + {name = "chocolate", price = 25, amount = 50, }, + {name = "butane", price = 25, amount = 50, }, + {name = "butanetorch", price = 2, amount = 1000, }, + {name = "dabrig", price = 2, amount = 1000, }, + {name = "mdwoods", price = 2, amount = 1000, }, + {name = "leancup", price = 25, amount = 50, }, + {name = "xtcburner", price = 25, amount = 50, }, + }, + Weed = { + {name = "weedgrinder", price = 25, amount = 50, }, + {name = "mdbutter", price = 25, amount = 50, }, + {name = "flour", price = 25, amount = 50, }, + {name = "chocolate", price = 25, amount = 50, }, + {name = "butane", price = 25, amount = 50, }, + {name = "butanetorch", price = 2, amount = 1000,}, + {name = "dabrig", price = 2, amount = 1000,}, + {name = "mdwoods", price = 2, amount = 1000}, + }, + Products = { + {name = "weed_white-widow_seed", price = 15, amount = 150, minrep = 0}, + {name = "weed_skunk_seed", price = 15, amount = 150, minrep = 0}, + {name = "weed_purple-haze_seed", price = 15, amount = 150, minrep = 0}, + {name = "weed_og-kush_seed", price = 15, amount = 150, minrep = 0}, + {name = "weed_amnesia_seed", price = 15, amount = 150, minrep = 0}, + }, + ProductsStupidNameRewrite = { + {name = "weed_whitewidow_seed", price = 15, amount = 150, minrep = 0}, + {name = "weed_skunk_seed", price = 15, amount = 150, minrep = 0}, + {name = "weed_purplehaze_seed", price = 15, amount = 150, minrep = 0}, + {name = "weed_ogkush_seed", price = 15, amount = 150, minrep = 0}, + {name = "weed_amnesia_seed", price = 15, amount = 150, minrep = 0}, + } +} + +lib.callback.register('md-drugs:server:menu', function(source, data) + local src = source + if data == 'travellingMerchant' then + return {table = stores.travel, des = '$', id = 'travellingMerchant', title = 'travelling Merchant'} + elseif data == 'dealermenu' then + local table + if Config.StupidassNewQbItemName then table = stores.ProductsStupidNameRewrite else table = stores.Products end + return {table = table, id = 'dealermenu', title = "Dealer Menu"} + elseif data == 'WeedShop' then + return {table = stores.Weed, id = 'WeedShop', title = "Weed Shop"} + end +end) + +RegisterServerEvent("md-drugs:server:purchaseGoods", function(amount, money, item, price,table,num) + local src = source local Player = getPlayer(src) + for i = 1, #table do + if table[i].name == item then + if not table[i].price == price then return end + if Player.Functions.RemoveMoney(tostring(money), tonumber(table[i].price) * tonumber(amount)) then + AddItem(src, item, amount) + Log(GetName(src) .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant') + end + end + end +end) + +lib.callback.register('md-drugs:server:GetMerchant', function(source) + return loc end) \ No newline at end of file From 9d828a2b15e1632d259c92f3eea27d76f133bbd7 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 12 Nov 2024 01:19:37 -0800 Subject: [PATCH 04/36] update readme --- readme.md | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/readme.md b/readme.md index 4f82244..78d42e2 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@
- +
Mustache Scripts Discord
@@ -10,26 +10,16 @@ # Credits - I used [Samuel's development](https://fivem.samueldev.shop/) Christmas script global states and prop spawning (with permission obtained prior to release) in the development process. - - Shout out to [STACHY225](https://babiczind.tebex.io/category/2103836) for working out the meth network animations! - - Huge credit to [Bostra](https://discord.gg/5ncbwMNq) for sharing free scripts and providing sanity checks during moments of confusion. Those cute mushrooms? His creation! - - Special thanks to [Feisty]() for the stunning visuals. If it looks good, she probably had a hand in it. - - Special shoutout to [Beta Testers]()Your feedback has been invaluable! - - Big Credit to [Bostra](https://discord.gg/5ncbwMNq). if you have been around you may have seen him post some free scripts and help people, There was definetly times I dm'd him saying what the fuck am I doing and he helped keep me sane. He also made the cute mushrooms! - - [Jim's Tebex](https://jimathy666.tebex.io/) for putting out open source resources that I was able to break and fix and learn how to code - - [jixeltay](https://jixeltay.tebex.io/category/scripts) for putting out banger after banger. These people help the community learn so much more - - Our partner [1of1 Servers]( https://1of1servers.com/) and their [discord](https://discord.gg/1of1servers) for their amazing server hosting! absolutely top notch. -- Special Thanks To Kamaryn For The Preview -- Thanks to Kamaryn for this [install guide video](https://youtu.be/zvuYnUfrqaA?si=FGJuBO5krZMC14Nd) +- Thanks to Kamaryn for this [install guide video](https://youtu.be/zvuYnUfrqaA?si=FGJuBO5krZMC14Nd) join their [discord](https://discord.gg/KPRmZqFS) for other videos updates. -- join their [discord](https://discord.gg/KPRmZqFS) for other videos updates. # Dependencies @@ -63,9 +53,43 @@ - delete `qb-drugs` ### STEP 3 -- Inside the config file change **all** the locations for everything. - - **ps: All locations have been changed to make a preview video easier and with how big of a script this is, Im not going to config it for every city. THESE LOCATION DO NOT DO WELL FOR A LIVE SERVER SO CHANGE THEM** +- all locations are in the server files now utilizing callbacks to build targets + - shops.lua + - travelling merchant + - Weed Store + - Dealer Shops + - locations.lua + - holds all old config options for locations. edit what you need in here + - if you previously had them in the config copy and paste the INTERIOR guts of the options. example below + ```lua + Config.MakePowder = { + {loc = vector3(1086.20, -3195.30, -39.20), 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 = ""}, + } + ``` + is now + ```lua + local Target = { + MakePowder = { + {loc = vector3(1086.20, -3195.30, -39.20), 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 = ""}, + } + } + ``` + - see its a simple change. + - recipes.lua + - handles the vast majority of remove X get Y + - Cornerselling.lua + - now the drug table is inserted into this file. + - copy and paste your data inside of the + ```lua + local Drugs = { + } + ``` + - all plant locations i.e. coke, heroin, weed, shrooms, mescaline are in the respective server files ### STEP 4 - Head to your emote script search for **uncuff** if it's missing add it - if rpemotes do this From abb1bba3fe7ff16a5985e581f4339bd38ef6476b Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 12 Nov 2024 02:07:16 -0800 Subject: [PATCH 05/36] fixed bugs --- client/functions.lua | 4 ++-- client/meth.lua | 2 -- client/pedspawns.lua | 3 ++- client/shrooms.lua | 20 ++++++++++++-------- fxmanifest.lua | 3 ++- server/crack.lua | 2 -- server/heroin.lua | 4 ++-- server/locations.lua | 7 +++++-- server/mescaline.lua | 3 ++- server/shops.lua | 7 +------ server/shrooms.lua | 4 ++-- 11 files changed, 30 insertions(+), 29 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 5ac1dbd..c2ed8a8 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -557,7 +557,7 @@ end RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() Wait(3000) - LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('mushroom') LoadModel('bkr_prop_weed_lrg_01b') + LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b') local check = lib.callback.await('md-drugs:server:GetRep', false) return @@ -565,7 +565,7 @@ end) AddEventHandler('onResourceStart', function(resource) if resource == GetCurrentResourceName() then - LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('mushroom') LoadModel('bkr_prop_weed_lrg_01b') + LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b') end end) local active = false diff --git a/client/meth.lua b/client/meth.lua index 72d1511..a18bb0c 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -110,8 +110,6 @@ CreateThread(function() if amonia and heated == nil then return true end end }) if Config.MethHeist == false then - local config = lib.callback.await('md-drugs:server:getLocs', false) - if not config then return end AddBoxZoneMulti('methep', config.MethEph, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.eph, event = 'md-drugs:client:stealeph'}) AddBoxZoneMulti('methace', config.Methace, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.ace, event = 'md-drugs:client:stealace'}) end diff --git a/client/pedspawns.lua b/client/pedspawns.lua index be4338e..57a2249 100644 --- a/client/pedspawns.lua +++ b/client/pedspawns.lua @@ -1,8 +1,9 @@ local QBCore = exports['qb-core']:GetCoreObject() -local config = lib.callback.await('md-drugs:server:getLocs', false) + CreateThread(function() + local config = lib.callback.await('md-drugs:server:getLocs', false) local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01'} for k, v in pairs (model) do lib.requestModel(v, Config.RequestModelTime) diff --git a/client/shrooms.lua b/client/shrooms.lua index 49054ca..9c21a44 100644 --- a/client/shrooms.lua +++ b/client/shrooms.lua @@ -1,18 +1,22 @@ local QBCore = exports['qb-core']:GetCoreObject() local shrooms = {} +local function LoadModels(hash) + hash = GetHashKey(hash) + RequestModel(hash) + local timeout = GetGameTimer() + 5000 -- 5-second timeout + while not HasModelLoaded(hash) and GetGameTimer() < timeout do + Wait(10) + end + if HasModelLoaded(hash) then return true end + +end + local function pick(loc) if not progressbar(Lang.Shrooms.pick, 4000, 'uncuff') then return end TriggerServerEvent("shrooms:pickupCane", loc) end -function LoadModel(hash) - RequestModel(hash) - while not HasModelLoaded(hash) do - Wait(0) - end -end - RegisterNetEvent('shrooms:respawnCane', function(loc) local v = GlobalState.shrooms[loc] local hash = GetHashKey(v.model) @@ -42,7 +46,7 @@ end) RegisterNetEvent("shrooms:init", function() for k, v in pairs (GlobalState.shrooms) do local hash = GetHashKey(v.model) - lib.requestModel(v.model, Config.RequestModelTime) + if not HasModelLoaded(hash) then LoadModels(hash) end if not v.taken then shrooms[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true) Freeze(shrooms[k], true, v.heading) diff --git a/fxmanifest.lua b/fxmanifest.lua index fd8c10b..888b143 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -26,7 +26,8 @@ lua54 'yes' dependency 'bob74_ipl' files { - 'stream/mushroom.ytyp' + 'stream/mushroom.ytyp', + 'stream/mushroom.ydr' } data_file 'DLC_ITYP_REQUEST' 'stream/mushroom.ytyp' diff --git a/server/crack.lua b/server/crack.lua index 6b41831..a800fdd 100644 --- a/server/crack.lua +++ b/server/crack.lua @@ -13,7 +13,6 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num) } for _, v in ipairs(crackTiers) do if count >= 1 then break end - print(v.item) if Player.Functions.GetItemByName(v.item) then tier = v.tier count = count + 1 @@ -21,7 +20,6 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num) end end end - print(tier) if not GetRecipe(src, 'crack', type, tier) then return end end) diff --git a/server/heroin.lua b/server/heroin.lua index e6fb115..4363447 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -1,5 +1,5 @@ local QBCore = exports['qb-core']:GetCoreObject() -GlobalState.PoppyPlants = Config.PoppyPlants + local h = { { location = vector3(-2251.3, -99.18, 100.11), heading = 334.49, model = "prop_plant_01b"}, { location = vector3(-2249.63, -92.97, 101.8), heading = 329.56, model = "prop_plant_01b"}, @@ -15,7 +15,7 @@ local h = { { location = vector3(-2250.96, -111.22, 97.50), heading = 21.52, model = "prop_plant_01b"}, { location = vector3(465.95, -1021.32, 31.78), heading = 21.52, model = "prop_plant_01b"}, } - +GlobalState.PoppyPlants = h Citizen.CreateThread(function() for _, v in pairs(h) do v.taken = false diff --git a/server/locations.lua b/server/locations.lua index 596fe59..e1114d5 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -129,7 +129,10 @@ function checkLoc(source, event, num) return false end end - +local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)] lib.callback.register('md-drugs:server:getLocs', function() return Target -end) \ No newline at end of file +end) +lib.callback.register('md-drugs:server:GetMerchant', function(source) + return loc +end) diff --git a/server/mescaline.lua b/server/mescaline.lua index 277af2e..2e88492 100644 --- a/server/mescaline.lua +++ b/server/mescaline.lua @@ -1,5 +1,5 @@ local QBCore = exports['qb-core']:GetCoreObject() -GlobalState.Mescaline = Config.Mescaline + local m = { { location = vector3(2598.73, 4207.89, 41.02), heading = 334.49, model = "prop_cactus_03"}, { location = vector3(2601.46, 4199.34, 40.62), heading = 329.56, model = "prop_cactus_03"}, @@ -19,6 +19,7 @@ local m = { { location = vector3(2614.39, 4188.3, 41.68), heading = 21.52, model = "prop_cactus_03"}, { location = vector3(2623.82, 4189.97, 41.44), heading = 21.52, model = "prop_cactus_03"}, } +GlobalState.Mescaline = m Citizen.CreateThread(function() for _, v in pairs(m) do v.taken = false diff --git a/server/shops.lua b/server/shops.lua index 0f1478f..3eb404f 100644 --- a/server/shops.lua +++ b/server/shops.lua @@ -1,6 +1,5 @@ local QBCore = exports['qb-core']:GetCoreObject() -local config = lib.callback.await('md-drugs:server:getLocs', false) -local loc = config.Travellingmerchant[math.random(1, #config.Travellingmerchant)] + local stores = { travel = { {name = "tab_paper", price = 50, amount = 50, }, @@ -79,7 +78,3 @@ RegisterServerEvent("md-drugs:server:purchaseGoods", function(amount, money, ite end end end) - -lib.callback.register('md-drugs:server:GetMerchant', function(source) - return loc -end) \ No newline at end of file diff --git a/server/shrooms.lua b/server/shrooms.lua index 781ef7a..beadb11 100644 --- a/server/shrooms.lua +++ b/server/shrooms.lua @@ -1,5 +1,5 @@ local QBCore = exports['qb-core']:GetCoreObject() -GlobalState.shrooms = Config.shrooms + local s = { { location = vector3(2185.14, 5183.81, 57.48), heading = 334.49, model = "mushroom"}, { location = vector3(2174.45, 5187.85, 57.43), heading = 329.56, model = "mushroom"}, @@ -19,7 +19,7 @@ local s = { { location = vector3(2185.85, 5190.49, 58.1), heading = 21.52, model = "mushroom"}, { location = vector3(2179.95, 5194.19, 58.26), heading = 21.52, model = "mushroom"}, } - +GlobalState.shrooms = s Citizen.CreateThread(function() for _, v in pairs(s) do v.taken = false From 8df50c04175deffa5335a8cc489f47e8f7310b9b Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 12 Nov 2024 02:36:45 -0800 Subject: [PATCH 06/36] moved things around --- server/cocaine.lua | 2 +- server/locations.lua | 2 +- server/lsd.lua | 2 +- shared/config.lua | 26 +++++++++++++------------- shared/qbdrugsrewrite.lua | 1 - 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/server/cocaine.lua b/server/cocaine.lua index d820702..8677c49 100644 --- a/server/cocaine.lua +++ b/server/cocaine.lua @@ -38,7 +38,7 @@ end RegisterNetEvent("coke:pickupCane") AddEventHandler("coke:pickupCane", function(loc) local src = source - --if CheckDist(src, Config.CocaPlant[loc].location) then return end + if CheckDist(src, cokeplants[loc].location) then return end if not cokeplants[loc].taken then cokeplants[loc].taken = true GlobalState.CocaPlant = cokeplants diff --git a/server/locations.lua b/server/locations.lua index e1114d5..03381c4 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -117,7 +117,7 @@ function checkLoc(source, event, num) local coord = GetEntityCoords(pos) local loc = '' if type(num) =='string' then - loc = Target[event][num] + loc = vector3(Target[event][num].x, Target[event][num].y, Target[event][num].z) else loc = Target[event][num].loc end diff --git a/server/lsd.lua b/server/lsd.lua index 6e97eba..3650e27 100644 --- a/server/lsd.lua +++ b/server/lsd.lua @@ -117,7 +117,7 @@ end) RegisterServerEvent('md-drugs:server:getlabkit', function() local src = source local Player = getPlayer(src) - if CheckDist(source, vector3(Config.buylsdlabkit.x, Config.buylsdlabkit.y, Config.buylsdlabkit.z)) then return end + if not checkLoc(src,'singleSpot', 'buylsdlabkit') then return end if Player.Functions.RemoveMoney('cash', Config.lsdlabkitcost) then AddItem(src,'lsdlabkit', 1) Log(GetName(src) ..' Bought A LSD Lab Kit!', 'lsd') diff --git a/shared/config.lua b/shared/config.lua index d2127f5..2f29ab3 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -6,6 +6,18 @@ Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn- Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, heroin, crack, lsd) Config.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total Config.RequestModelTime = 30000 -- if you need more time than this, uhhhh wow +Config.minigametype = 'ox' -- look above for options or choose none if you dont want any minigames +Config.FancyCokeAnims = false -- if you want multi location this needs to be false +Config.PharmaJob = "ems" -- what TYPE role you need to be on to get the command +Config.Joblock = false -- if you want weed to be a job +Config.weedjob = "" -- what the job name is +Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline +Config.MethHeist = false +Config.SuccessfulChance = 90 --- this is the chance of a Success wholesale 1-100 +Config.AlertPoliceWholesale = 90 -- 1-100 of how often it will alert police +Config.WholesaleTimeout = 600 -- time in seconds to get to the location +Config.PoliceCount = 0 -- Amount of police required +Config.PoliceAlertOxy = 90 -- This is a % out of 100 to alert police ----------------------------------- TierSystem levels ** ONLY IN USE IF CONFIG.TIERSYTEM IS TRUE Config.Tier1 = 100 -- amount to hit for level 2 @@ -36,20 +48,8 @@ Config.Minigames = { glmath = {timeLimit = 300000}, } -Config.minigametype = 'ox' -- look above for options or choose none if you dont want any minigames -Config.FancyCokeAnims = false -- if you want multi location this needs to be false +--- TODO: Move these to server files Config.tabcost = 100 -- price per piece of tab paper event does 10 at a time Config.lsdlabkitcost = 10000 -- price of the lsd lab kit Config.heroinlabkitprice = 10000 -- price of the lsd lab kit -Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline -Config.PharmaJob = "ems" -- what TYPE role you need to be on to get the command -Config.Joblock = false -- if you want weed to be a job -Config.weedjob = "" -- what the job name is - -Config.SuccessfulChance = 90 --- this is the chance of a Success wholesale 1-100 -Config.AlertPoliceWholesale = 90 -- 1-100 of how often it will alert police -Config.WholesaleTimeout = 600 -- time in seconds to get to the location -Config.PoliceCount = 0 -- Amount of police required -Config.PoliceAlertOxy = 90 -- This is a % out of 100 to alert police -Config.MethHeist = false \ No newline at end of file diff --git a/shared/qbdrugsrewrite.lua b/shared/qbdrugsrewrite.lua index 057c38d..09651a2 100644 --- a/shared/qbdrugsrewrite.lua +++ b/shared/qbdrugsrewrite.lua @@ -1,7 +1,6 @@ QBConfig = {} ----------- qb-drugs update built in here below ----------- Everything is now a target and not displaytext. Dealers are no longer just doors, they will spawn peds where you place your dealer. This is a literally qb-drugs with SLIGHT edits. mainly added peds for deliveries, made everything a target ------------- and changed the range a ped will walk up to you to be a bigger radius. QBConfig.MinimumDrugSalePolice = 0 QBConfig.MarkedBills = true -- if false on both options below then it auto converts selling to give cash From 07c84ff64064752cd71b6959de1ec1260da20ec7 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:08:02 -0800 Subject: [PATCH 07/36] test --- client/cocaine.lua | 2 +- client/cornerselling.lua | 45 ++++++++++++--------- client/deliveries.lua | 28 ++++++------- client/functions.lua | 50 ++++++++++++++++++++++- client/heroin.lua | 7 ++-- client/xtc.lua | 2 +- server/cornerselling.lua | 73 ++++++++++++++++++++++++++------- server/deliveries.lua | 85 +++++++++++++++++++++------------------ server/locations.lua | 8 ++-- shared/config.lua | 2 +- shared/qbdrugsrewrite.lua | 2 +- 11 files changed, 201 insertions(+), 103 deletions(-) diff --git a/client/cocaine.lua b/client/cocaine.lua index 621e64d..ed12605 100644 --- a/client/cocaine.lua +++ b/client/cocaine.lua @@ -79,7 +79,7 @@ end) CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) - if not config then return end + if not config then print('why') return end if Config.FancyCokeAnims == false then AddBoxZoneMulti('cuttcoke', config.CuttingCoke, { type = "client",event = "md-drugs:client:cutcokeone", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.coke.cut}) AddBoxZoneMulti('baggcoke', config.BaggingCoke, { type = "client",event = "md-drugs:client:bagcoke", icon = "fa-solid fa-sack-xmark", label = Lang.targets.coke.bag}) diff --git a/client/cornerselling.lua b/client/cornerselling.lua index 683cd52..003430d 100644 --- a/client/cornerselling.lua +++ b/client/cornerselling.lua @@ -3,7 +3,7 @@ local sell = false local sold = false local targbusy = false local inZone = false - +local active = false local function reset(targ) FreezeEntityPosition(targ, false) ClearPedTasks(targ) @@ -11,6 +11,7 @@ local function reset(targ) DeletePed(targ) targbusy = false sold = true + active = false end local function sellDrug(item, amount, price, targ) @@ -33,30 +34,30 @@ local function deny(targ) 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 = lib.callback.await('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) - local item, amount, price = lib.callback.await('md-drugs:server:cornerselling:getAvailableDrugs', false) - if item == 'nothing' then Notify(Lang.Cornerselling.nodrugs, 'error') sell = false FreezeEntityPosition(targ, false) ClearPedTasks(targ) return false end - local options = { - { label = string.format(Lang.targets.CornerSell.sell, amount, GetLabel(item), price), icon ="fa-solid fa-money-bill", - action = function() sellDrug(item, amount, 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, - }, - } - AddMultiModel(targ, options, nil) + 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, + }}, nil) repeat Wait(1000) until sold @@ -66,17 +67,19 @@ 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 item, amount, price = lib.callback.await('md-drugs:server:cornerselling:getAvailableDrugs', false) - if item ~= 'nothing' then + local has = lib.callback.await('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) - if not Cornersell() then end + Cornersell() until not sell end else @@ -89,4 +92,8 @@ 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) end) \ No newline at end of file diff --git a/client/deliveries.lua b/client/deliveries.lua index b7c85e7..d626a46 100644 --- a/client/deliveries.lua +++ b/client/deliveries.lua @@ -16,21 +16,19 @@ CreateThread(function() local loc = json.decode(v.coords) dealer[k] = CreatePed(0, Ped,loc.x,loc.y, loc.z-1, loc.h, false, false) Freeze(dealer[k], true, loc.h) - local options = { - { icon = 'fas fa-user-secret', label = string.format(Lang.targets.Delivery.Deliver, v.name), - action = function() - local bool, item, amount, coords = lib.callback.await('md-drugs:server:GetDeliveryItem', false, k) - if bool then - 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}) - end - end, - }, - { icon = "fa-solid fa-store", label = string.format(Lang.targets.Delivery.open, v.name), - action = function() TriggerEvent('md-drugs:client:opendealermenu') end, - } - } - AddMultiModel(dealer[k], options) + AddMultiModel(dealer[k], { + { icon = 'fas fa-user-secret', label = string.format(Lang.targets.Delivery.Deliver, v.name), + action = function() + local bool, item, amount, coords = lib.callback.await('md-drugs:server:GetDeliveryItem', false, k) + if bool then + 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}) + end + end, + }, + { icon = "fa-solid fa-store", label = string.format(Lang.targets.Delivery.open, v.name), + action = function() TriggerEvent('md-drugs:client:opendealermenu') end, + }}, dealer[k]) end end) diff --git a/client/functions.lua b/client/functions.lua index c2ed8a8..a0e826f 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -391,6 +391,24 @@ function AddBoxZoneSingle(name, loc, 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 @@ -427,6 +445,25 @@ function AddBoxZoneMulti(name, table, data) 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, + 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 @@ -437,6 +474,8 @@ function AddBoxZoneMultiOptions(name, loc, data) { options = data, distance = 2.5}) elseif Config.Target == 'ox' then exports.ox_target:addBoxZone({coords = loc, size = vec3(1,1,1), options = data }) + elseif Config.Target == 'interact' then + exports.interact:AddInteraction({coords = vector3(loc.x, loc.y, loc.z),distance = 2.5,interactDst = 2,id = name,options = data}) end end @@ -448,21 +487,26 @@ function AddSingleModel(model, 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,{ + options[#options + 1] = { icon = v.icon, 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 + exports.interact:AddLocalEntityInteraction({entity = model,offset = vec3(0.0, 0.0, 1.0),id = 'mddrugsmulti'..model,distance = 2.5,interactDst = 2.5, options = options}) end end @@ -471,6 +515,7 @@ local heading = 180.0 function StartRay() local run = true local pedcoord = GetEntityCoords(PlayerPedId()) + lib.requestModel('v_ret_ml_tablea', 30000) local table = CreateObject('v_ret_ml_tablea', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false) repeat local hit, entityHit, endCoords, surfaceNormal, matHash = lib.raycast.cam(511, 4, 10) @@ -514,6 +559,7 @@ end function StartRay2() local run = true local pedcoord = GetEntityCoords(PlayerPedId()) + lib.requestModel('v_ret_ml_tablea', 30000) local table = CreateObject('bkr_prop_coke_press_01aa', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false) repeat local hit, entityHit, endCoords, surfaceNormal, matHash = lib.raycast.cam(511, 4, 10) diff --git a/client/heroin.lua b/client/heroin.lua index 5e3ee00..198183f 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -6,11 +6,10 @@ local herointable = false local heroinlabkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false,false) SetEntityHeading(heroinlabkit, head) PlaceObjectOnGroundProperly(heroinlabkit) - local options = { + AddMultiModel(heroinlabkit, { { event = "md-drugs:client:heatliquidheroin", icon = "fa-solid fa-temperature-high", label = Lang.targets.heroin.cook, data = heroinlabkit}, - { event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.up, data = heroinlabkit, canInteract = function() if herointable then return true end end}, - } - AddMultiModel(heroinlabkit, options, heroinlabkit) + { event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.up, data = heroinlabkit, canInteract = function() if herointable then return true end end}}, + heroinlabkit) end local function pickher(loc) diff --git a/client/xtc.lua b/client/xtc.lua index d8ebe1e..1e85087 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -10,7 +10,7 @@ RegisterNetEvent("md-drugs:client:setpress", function(type) progressbar('Setting Press On The Ground', 4000, 'uncuff') local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false) PlaceObjectOnGroundProperly(press) - SetEntityHeading(press, head) + Freeze(press, true, head) local options = { { icon = "fas fa-eye", label = Lang.targets.xtc.make, distance = 2.0, action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end, canInteract = function() if xtcpress then return true end end diff --git a/server/cornerselling.lua b/server/cornerselling.lua index 87e9be7..01391e2 100644 --- a/server/cornerselling.lua +++ b/server/cornerselling.lua @@ -1,4 +1,5 @@ local QBCore = exports['qb-core']:GetCoreObject() +local DrugDeals = {} local Drugs = { ["weed_white-widow"] = {rep = 1,min = 15, max = 24 }, ["weed_og-kush"] = {rep = 1,min = 15, max = 28 }, @@ -120,7 +121,7 @@ local Drugs = { ["cupofdextro"] = {rep = 1,min = 18, max = 40}, } -lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, cb) +lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, ped) local Player = getPlayer(source) local rep = getRep(source, 'cornerselling') if not Player then return nil end @@ -134,14 +135,25 @@ lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', functio if amount >= 15 then amount = 15 end local price = math.random(Drugs[k]['min'], Drugs[k]['max']) * amount local result = math.floor(price * rep.price) - return item.name, amount, result + table.insert(DrugDeals, {item = item.name, amount = amount, price = result, cid = Player.PlayerData.citizenid, ped = ped}) + return {item = item.name, amount = amount, price = result, ped = ped} end end if type == 0 then - return 'nothing', 0, 0 + return {item = 'nothing', amount = 0, price = 0, ped = ped} end end) +lib.callback.register('md-drugs:server:hasDrugs', function(source) + local Player = getPlayer(source) + for k, v in pairs(Drugs) do + local item = Player.Functions.GetItemByName(k) + if item then + return true + end + end + return false +end) RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price) local src = source @@ -153,19 +165,30 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price end end if not isIn then return end - if RemoveItem(src, item, amount) then - if QBConfig.MarkedBills then - local info = { - worth = price - } - Player.Functions.AddItem('markedbills', 1, false, info ) - elseif QBConfig.CustomDirtyMoney then - AddItem(src, QBConfig.CustomDirtyMoneyitem, price) - else - Player.Functions.AddMoney('cash', price) + for k, v in pairs (DrugDeals) do + if v.cid == Player.PlayerData.citizenid then + if v.item == item then + if v.amount == amount then + if v.price == price then + if RemoveItem(src, item, amount) then + if QBConfig.MarkedBills then + local info = { + worth = price + } + Player.Functions.AddItem('markedbills', 1, false, info ) + elseif QBConfig.CustomDirtyMoney then + AddItem(src, QBConfig.CustomDirtyMoneyitem, price) + else + Player.Functions.AddMoney('cash', price) + end + AddRep(src, 'cornerselling', Drugs[item].rep * amount) + Log(GetName(src) .. ' Sold ' .. amount .. ' Of ' .. item .. ' For A Price Of ' .. price .. '!' , 'cornerselling') + table.remove(DrugDeals, k) + end + end + end + end end - AddRep(src, 'cornerselling', Drugs[item].rep * amount) - Log(GetName(src) .. ' Sold ' .. amount .. ' Of ' .. item .. ' For A Price Of ' .. price .. '!' , 'cornerselling') end end) @@ -179,3 +202,23 @@ lib.addCommand('cornersell', { Log(GetName(source) .. ' Used Command cornersell!' , 'cornerselling') TriggerClientEvent('md-drugs:client:cornerselling', src) end) + +RegisterServerEvent('md-drugs:server:cornerselling:stop', function() + local src = source + local Player = getPlayer(src) + for k, v in pairs (DrugDeals) do + if v.cid == Player.PlayerData.citizenid then + TriggerClientEvent('md-drugs:client:cornerselling:remove', src, DrugDeals[k].ped) + table.remove(DrugDeals, k) + end + end +end) + +CreateThread(function() +while true do + for k, v in pairs (DrugDeals) do + print('DrugDeals: ', json.encode(v)) + end + Wait(1000) +end +end) \ No newline at end of file diff --git a/server/deliveries.lua b/server/deliveries.lua index c1fbeb5..c8429d5 100644 --- a/server/deliveries.lua +++ b/server/deliveries.lua @@ -65,62 +65,67 @@ RegisterNetEvent('md-drugs:server:giveDeliveryItems', function(item, amount) end end) --- Commands -QBCore.Commands.Add("newdealer", "Place a dealer (Admin Only)", {{ name = "name", help = "Dealer name"}, { name = "min", help = "Minimum Time"}, {name = "max", help = "Maximum Time"}}, true, function(source, args) +lib.addCommand("newdealer", { + help = "Place a dealer (Admin Only)", + params = { + { name = "name", help = "Dealer Name", type = "string" }, + { name = "min", help = "Minimum Time", type = "number" }, + { name = "max", help = "Maximum Time", type = "number" } + }, + restricted = "admin" +}, function(source, args) local ped = GetPlayerPed(source) local coords = GetEntityCoords(ped) local Player = getPlayer(source) if not Player then return end - local dealerName = args[1] - local minTime = tonumber(args[2]) - local maxTime = tonumber(args[3]) + + local dealerName = args.name + local minTime = args.min + local maxTime = args.max local time = json.encode({min = minTime, max = maxTime}) local pos = json.encode({x = coords.x, y = coords.y, z = coords.z}) - local result = MySQL.scalar.await('SELECT name FROM dealers WHERE name = ?', {dealerName}) - if result then return TriggerClientEvent('QBCore:Notify', source, "Already Exists", "error") end - MySQL.insert('INSERT INTO dealers (name, coords, time, createdby) VALUES (?, ?, ?, ?)', {dealerName, pos, time, Player.PlayerData.citizenid}, function() + + local result = MySQL.scalar.await('SELECT name FROM dealers WHERE name = ?', { dealerName }) + if result then + return Notifys(source,"Already Exists", "error") + end + + MySQL.insert('INSERT INTO dealers (name, coords, time, createdby) VALUES (?, ?, ?, ?)', { + dealerName, pos, time, Player.PlayerData.citizenid + }, function() QBConfig.Dealers[dealerName] = { - ["name"] = dealerName, - ["coords"] = { - ["x"] = coords.x, - ["y"] = coords.y, - ["z"] = coords.z, + name = dealerName, + coords = { + x = coords.x, + y = coords.y, + z = coords.z, + h = GetEntityHeading(ped) }, - ["time"] = { - ["min"] = minTime, - ["max"] = maxTime + time = { + min = minTime, + max = maxTime }, - ["products"] = QBConfig.Products } TriggerClientEvent('md-drugs:client:RefreshDealers', -1, QBConfig.Dealers) end) -end, "admin") +end) + +lib.addCommand("deletedealer", { + help = "Delete a dealer (Admin Only)", + params = { + { name = "name", help = "Dealer Name", type = "string" } + }, + restricted = 'group.admin' +}, function(source, args) + local dealerName = args.name + local result = MySQL.scalar.await('SELECT * FROM dealers WHERE name = ?', { dealerName }) -QBCore.Commands.Add("deletedealer", "Delete a dealer (Admin Only)", {{ - name = "name", - help = "Dealer Name" -}}, true, function(source, args) - local dealerName = args[1] - local result = MySQL.scalar.await('SELECT * FROM dealers WHERE name = ?', {dealerName}) if result then - MySQL.query('DELETE FROM dealers WHERE name = ?', {dealerName}) + MySQL.query('DELETE FROM dealers WHERE name = ?', { dealerName }) QBConfig.Dealers[dealerName] = nil TriggerClientEvent('md-drugs:client:RefreshDealers', -1, QBConfig.Dealers) - TriggerClientEvent('QBCore:Notify', source, "Dealer Deleted" , "success") + TriggerClientEvent('QBCore:Notify', source, "Dealer Deleted", "success") else TriggerClientEvent('QBCore:Notify', source, "Who You Tryna Delete", "error") end -end, "admin") - -RegisterServerEvent("md-drugs:server:Dealershop", function(amount, value, item, info) - local src = source - local Player = getPlayer(src) - local balance = Player.Functions.GetMoney(tostring(value)) - if Player.Functions.RemoveMoney(tostring(value), tonumber(info) * tonumber(amount)) then - TriggerClientEvent('inventory:client:ItemBox', src, item.name, "add", amount) - Player.Functions.AddItem(item, amount) - else - TriggerClientEvent('QBCore:Notify', source, "Can't give item!", "error") - end - -end) +end) \ No newline at end of file diff --git a/server/locations.lua b/server/locations.lua index 03381c4..1561f44 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -8,13 +8,13 @@ local Target = { {loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, BaggingCoke = { -- 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(1093.16, -3195.78, -39.19), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, makecrack = { -- make crack with baking soda with cut coke 1-3 - {loc = vector3(2434.07, 4969.39, 42.35), 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 = ""}, }, bagcrack = { --- bag crack 1-3 stages - {loc = vector3(2435.85, 4965.3, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, + {loc = vector3(2436.55, 4964.96, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, lysergicacid = { -- get lysergic acid {loc = vector3(-1381.21, -327.75, 39.85), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, @@ -54,7 +54,7 @@ local Target = { }, singleSpot = { cutcoke = vector3(1093.17, -3195.74, -39.19), - bagcokepowder = vector3(1090.29, -3195.66, -39.13), + bagcokepowder = vector3(1090.28, -3195.65, -39.19), 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 buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), -- buy lab kit for lsd diff --git a/shared/config.lua b/shared/config.lua index 2f29ab3..ae87a56 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -1,6 +1,6 @@ Config = {} --Ignore. -Config.Target = 'ox' -- qb or ox +Config.Target = 'interact' -- qb or ox Config.respawnTime = 10 -- Seconds 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) diff --git a/shared/qbdrugsrewrite.lua b/shared/qbdrugsrewrite.lua index 09651a2..96139e3 100644 --- a/shared/qbdrugsrewrite.lua +++ b/shared/qbdrugsrewrite.lua @@ -3,7 +3,7 @@ QBConfig = {} ----------- Everything is now a target and not displaytext. Dealers are no longer just doors, they will spawn peds where you place your dealer. This is a literally qb-drugs with SLIGHT edits. mainly added peds for deliveries, made everything a target QBConfig.MinimumDrugSalePolice = 0 -QBConfig.MarkedBills = true -- if false on both options below then it auto converts selling to give cash +QBConfig.MarkedBills = false -- if false on both options below then it auto converts selling to give cash QBConfig.CustomDirtyMoney = false QBConfig.CustomDirtyMoneyitem = '' QBConfig.Dealers = {} From e04d91e79e64bfb8cc937b91beefed0b48d0452e Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:22:12 -0800 Subject: [PATCH 08/36] update readme --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 78d42e2..430c563 100644 --- a/readme.md +++ b/readme.md @@ -207,7 +207,7 @@ As well as a place to offload images and videos from fivem that doesnt rely on d - [Fivemerr Discord](https://discord.com/invite/fivemerr) - [Fivemerr Docs](https://docs.fivemerr.com/) -# Radial Menu +## Radial Menu - head to `qb-radial/config.lua` and search for the following event ```lua event = 'qb-drugs:client:cornerselling', @@ -218,7 +218,7 @@ As well as a place to offload images and videos from fivem that doesnt rely on d ``` -# For Qb-shops users +## For Qb-shops users - Head to `qb-shops/config.lua` **Config.Products** and add the folowing items to OR anywhere else you want them. The Only way in this script to get them is to find the travelling merchant @@ -228,7 +228,7 @@ As well as a place to offload images and videos from fivem that doesnt rely on d {name = 'needle', price = 100, amount = 5000, info = {}, type = 'item'}, ``` -# Tier System +## Tier System - Turn On Config.TierSystem after you run the sql file [mlo i use](https://www.gta5-mods.com/maps/mlo-4x-drug-lab-interiors-sp-fivem) heres an option. use it or dont. From 07481651b8217f99558b0165458e55ed7c3807fc Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 16 Nov 2024 23:39:22 -0800 Subject: [PATCH 09/36] test --- server/locations.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/locations.lua b/server/locations.lua index 1561f44..01826cf 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -11,7 +11,7 @@ local Target = { {loc = vector3(1093.16, -3195.78, -39.19), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, 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(2434.07, 4969.39, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, bagcrack = { --- bag crack 1-3 stages {loc = vector3(2436.55, 4964.96, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, From c81d1134945308770d3c87f1299211da57440628 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 16 Nov 2024 23:39:34 -0800 Subject: [PATCH 10/36] test2 --- client/functions.lua | 4 + server/heroin.lua | 26 ++--- server/locations.lua | 4 +- server/lsd.lua | 13 ++- server/oxyruns.lua | 17 +-- server/recipes.lua | 252 +++++++++++++++++++++---------------------- server/weed.lua | 2 +- shared/config.lua | 17 ++- 8 files changed, 171 insertions(+), 164 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index a0e826f..42f6cb4 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -180,6 +180,7 @@ function minigame() function GetImage(img) if GetResourceState('ox_inventory') == 'started' then local Items = exports['ox_inventory']:Items() + if not Items[img] then print(' You Are Missing: ' .. img .. ' From Your ox items.lua') return end local itemClient = Items[img] and Items[img]['client'] if itemClient and itemClient['image'] then return itemClient['image'] @@ -196,6 +197,7 @@ function GetImage(img) ['core_inventory'] = "nui://core_inventory/html/img/" } for k, v in pairs(invs) do + if not QBCore.Shared.Items[img] then print(' You Are Missing: ' .. img .. ' From Your QB items.lua') return end if GetResourceState(k) == 'started' then return v .. QBCore.Shared.Items[img].image end @@ -205,8 +207,10 @@ end function GetLabel(label) if GetResourceState('ox_inventory') == 'started' then local Items = exports['ox_inventory']:Items() + if not Items[img] then print(' You Are Missing: ' .. img .. ' From Your ox items.lua') return end return Items[label]['label'] else + if QBCore.Shared.Items[label] == nil then print("There Is No " .. label .. " In Your QB Items.lua") return end return QBCore.Shared.Items[label]['label'] end end diff --git a/server/heroin.lua b/server/heroin.lua index 4363447..a4bf794 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -1,5 +1,7 @@ local QBCore = exports['qb-core']:GetCoreObject() - +local prices = { + heroinlabkitprice = 10000 +} local h = { { location = vector3(-2251.3, -99.18, 100.11), heading = 334.49, model = "prop_plant_01b"}, { location = vector3(-2249.63, -92.97, 101.8), heading = 329.56, model = "prop_plant_01b"}, @@ -64,17 +66,17 @@ RegisterServerEvent('md-drugs:server:dryplant', function(num) local heroin = getRep(src, 'heroin') if heroin <= Config.Tier1 then if not GetRecipe(src, 'heroin', 'dryheroin', 'tier1') then return end - Log(GetName(src) ..' Made Heroin Powder With a distance of ' .. dist(source, Config.dryplant[num]['loc']) .. ' vectors', 'heroin') + Log(GetName(src) ..' Made Heroin Powder', 'heroin') elseif heroin >= Config.Tier1 and heroin <= Config.Tier2 then if not GetRecipe(src, 'heroin', 'dryheroin', 'tier2') then return end - Log(GetName(src) ..' Made Heroin Powder Tier 2 With a distance of ' .. dist(source, Config.dryplant[num]['loc']) .. ' vectors', 'heroin') + Log(GetName(src) ..' Made Heroin Powder Tier 2', 'heroin') else if not GetRecipe(src, 'heroin', 'dryheroin', 'tier3') then return end - Log(GetName(src) ..' Made Heroin Powder Tier 3 With a distance of ' .. dist(source, Config.dryplant[num]['loc']) .. ' vectors', 'heroin') + Log(GetName(src) ..' Made Heroin Powder Tier 3', 'heroin') end else if not GetRecipe(src, 'heroin', 'dryheroin', 'tier1') then return end - Log(GetName(src) ..' Made Heroin Powder With a distance of ' .. dist(source, Config.dryplant[num]['loc']) .. ' vectors', 'heroin') + Log(GetName(src) ..' Made Heroin Powder With a distance of', 'heroin') end end) @@ -90,19 +92,19 @@ RegisterServerEvent('md-drugs:server:cutheroin', function(num) local rawh3 = Player.Functions.GetItemByName('heroinstagethree') if rawh then if not GetRecipe(src, 'heroin', 'cutheroin', 'tier1') then return end - Log(GetName(src) ..' Cut Heroin With a distance of ' .. dist(source, Config.cutheroinone[num]['loc']) .. ' vectors', 'heroin') + Log(GetName(src) ..' Cut Heroin With a distance of', 'heroin') elseif rawh2 then if not GetRecipe(src, 'heroin', 'cutheroin', 'tier2') then return end - Log(GetName(src) ..' Cut Heroin Tier 2 With a distance of ' .. dist(source, Config.cutheroinone[num]['loc']) .. ' vectors', 'heroin') + Log(GetName(src) ..' Cut Heroin Tier 2 With a distance of', 'heroin') elseif rawh3 then if not GetRecipe(src, 'heroin', 'cutheroin', 'tier3') then return end - Log(GetName(src) .. ' Cut Heroin Tier 3 With a distance of ' .. dist(source, Config.cutheroinone[num]['loc']) .. ' vectors', 'heroin') + Log(GetName(src) .. ' Cut Heroin Tier 3 With a distance of', 'heroin') else Notifys(src, Lang.Heroin.noheroin, "error") end else if not GetRecipe(src, 'heroin', 'cutheroin', 'tier1') then return end - Log(GetName(src) ..' Cut Heroin With a distance of ' .. dist(source, Config.cutheroinone[num]['loc']) .. ' vectors', 'heroin') + Log(GetName(src) ..' Cut Heroin With a distance of', 'heroin') end end) @@ -110,11 +112,11 @@ RegisterServerEvent('md-drugs:server:getheroinlabkit', function() local src = source local Player = getPlayer(src) if not checkLoc(source, 'singleSpot', 'buyheroinlabkit') then return end - if Player.Functions.RemoveMoney('cash', Config.heroinlabkitprice) then + if Player.Functions.RemoveMoney('cash', prices.heroinlabkitprice) then AddItem(src, 'heroinlabkit', 1) - Log(GetName(src) ..' Bought A Heroin lab Kit ' .. dist(source, vector3(Config.buyheroinlabkit.x,Config.buyheroinlabkit.y,Config.buyheroinlabkit.z)) .. ' vectors', 'heroin') + Log(GetName(src) ..' Bought A Heroin lab Kit', 'heroin') else - Notifys(src, 'You Need '.. Config.heroinlabkitprice .. ' In Cash For This', 'error') + Notifys(src, 'You Need '.. prices.heroinlabkitprice .. ' In Cash For This', 'error') end end) diff --git a/server/locations.lua b/server/locations.lua index 01826cf..0311975 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -92,8 +92,8 @@ local Target = { }, Travellingmerchant = { -- where the travelling merchant can spawn vector4(-119.66, -977.43, 304.25, 88.21), - vector4(-1522.93, 1476.01, 111.45, 41.25), - vector4(-3278.98, 973.38, 5.35, 101.53), + vector4(-1522.93, 1476.01, 111.45, 41.25), + vector4(-3278.98, 973.38, 5.35, 101.53), }, oxylocations = { vector4(-2352.32, 266.78, 165.3, 23.46), diff --git a/server/lsd.lua b/server/lsd.lua index 3650e27..a2d1b72 100644 --- a/server/lsd.lua +++ b/server/lsd.lua @@ -1,10 +1,13 @@ local QBCore = exports['qb-core']:GetCoreObject() - +local prices = { + tabcost = 100, -- price per piece of tab paper event does 10 at a time + lsdlabkitcost = 10000 -- price of the lsd lab kit +} RegisterServerEvent('md-drugs:server:getlysergic', function(num) local src = source if not checkLoc(src, 'lysergicacid', num) then return end if AddItem(src,'lysergic_acid', 2) then - Log(GetName(src) ..' Got Lysergic acid with a distance of ' .. dist(source, Config.lysergicacid[num]['loc']) .. '!', 'lsd') + Log(GetName(src) ..' Got Lysergic acid!', 'lsd') end end) @@ -12,7 +15,7 @@ RegisterServerEvent('md-drugs:server:getdiethylamide', function(num) local src = source if not checkLoc(src, 'diethylamide', num) then return end if AddItem(src,'diethylamide', 2) then - Log(GetName(src) ..' Got Diethylamide with a distance of ' .. dist(source, Config.diethylamide[num]['loc']) .. '!', 'lsd') + Log(GetName(src) ..' Got diethylamide!', 'lsd') end end) @@ -106,7 +109,7 @@ RegisterServerEvent('md-drugs:server:gettabpaper', function(num) local src = source local Player = getPlayer(src) if not checkLoc(src, 'gettabs', num) then return end - if Player.Functions.RemoveMoney('cash', Config.tabcost * 10) then + if Player.Functions.RemoveMoney('cash', prices.tabcost * 10) then AddItem(src,'tab_paper', 10) Log(GetName(src) ..' Bought Tab Paper!', 'lsd') else @@ -118,7 +121,7 @@ RegisterServerEvent('md-drugs:server:getlabkit', function() local src = source local Player = getPlayer(src) if not checkLoc(src,'singleSpot', 'buylsdlabkit') then return end - if Player.Functions.RemoveMoney('cash', Config.lsdlabkitcost) then + if Player.Functions.RemoveMoney('cash', prices.lsdlabkitcost) then AddItem(src,'lsdlabkit', 1) Log(GetName(src) ..' Bought A LSD Lab Kit!', 'lsd') else diff --git a/server/oxyruns.lua b/server/oxyruns.lua index 4dbff99..cf2cc77 100644 --- a/server/oxyruns.lua +++ b/server/oxyruns.lua @@ -1,9 +1,13 @@ QBCore = exports['qb-core']:GetCoreObject() - +local prices = { + payfortruck = 500, + hotchance = 30, + itemChance = 20, +} lib.callback.register('md-drugs:server:payfortruck', function() local src = source local Player = getPlayer(src) - if Player.Functions.RemoveMoney('cash', 500) or Player.Functions.RemoveMoney('bank', 500) then + if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy') return true else @@ -21,21 +25,20 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function() local itemchance = math.random(1,100) local itemList = { {item = 'oxy', amount = 2}, - {item = 'lockpick', amount = 1}, - {item = 'cryptostick', amount = 1}, + {item = 'houselockpick', amount = 1}, } local item = itemList[math.random(1, #itemList)] - if chance <= 30 then + if chance <= prices.hotchance then Notifys(src, Lang.oxy.hot, "error") Player.Functions.AddMoney("cash", cash * 0.5) - if itemchance <= 30 then + if itemchance <= prices.itemChance then AddItem(src, item.item, item.amount) end else Notifys(Lang.oxy.next, "success") TriggerClientEvent("md-drugs:client:getoxylocationroute", src) Player.Functions.AddMoney("cash", cash) - if itemchance <= 30 then + if itemchance <= prices.itemChance then AddItem(src, item.item, item.amount) end end diff --git a/server/recipes.lua b/server/recipes.lua index 361ba0b..42ba93a 100644 --- a/server/recipes.lua +++ b/server/recipes.lua @@ -2,137 +2,137 @@ local QBCore = exports['qb-core']:GetCoreObject() local recipe = { cocaine = { - cokepowder = { - tier1 = {take = {coca_leaf = 1}, give = {coke = 1}}, - tier2 = {take = {coca_leaf = 1}, give = {cokestagetwo = 1}}, - tier3 = {take = {coca_leaf = 1}, give = {cokestagethree = 1}}, - }, - cutcoke = { - tier1 = {take = {coke = 1, bakingsoda = 1}, give = {loosecoke = 1}}, - tier2 = {take = {cokestagetwo = 1, bakingsoda = 1}, give = {loosecokestagetwo = 1}}, - tier3 = {take = {cokestagethree = 1, bakingsoda = 1}, give = {loosecokestagethree = 1}}, - }, - bagcoke = { - tier1 = {take = {loosecoke = 1, empty_weed_bag = 1}, give = {cokebaggy = 1}}, - tier2 = {take = {loosecokestagetwo = 1, empty_weed_bag = 1}, give = {cokebaggystagetwo = 1}}, - tier3 = {take = {loosecokestagethree = 1, empty_weed_bag = 1}, give = {cokebaggystagethree = 1}}, - } - }, - crack = { - cookcrack = { - tier1 = {take = {loosecoke = 1, bakingsoda = 1}, give = {crackrock = 1}}, - tier2 = {take = {loosecokestagetwo = 1, bakingsoda = 1}, give = {crackrockstagetwo = 1}}, - tier3 = {take = {loosecokestagethree = 1,bakingsoda = 1}, give = {crackrockstagethree = 1}}, + cokepowder = { + tier1 = {take = {coca_leaf = 8}, give = {coke = 1}}, + tier2 = {take = {coca_leaf = 8}, give = {cokestagetwo = 1}}, + tier3 = {take = {coca_leaf = 8}, give = {cokestagethree = 1}}, }, - bagcrack = { - tier1 = {take = {crackrock = 1, empty_weed_bag = 1}, give = {baggedcracked = 1}}, - tier2 = {take = {crackrockstagetwo = 1, empty_weed_bag = 1}, give = {baggedcrackedstagetwo = 1}}, - tier3 = {take = {crackrockstagethree = 1, empty_weed_bag = 1}, give = {baggedcrackedstagethree = 1}}, + cutcoke = { + tier1 = {take = {coke = 1, bakingsoda = 1}, give = {loosecoke = 7}}, + tier2 = {take = {cokestagetwo = 1, bakingsoda = 1}, give = {loosecokestagetwo = 7}}, + tier3 = {take = {cokestagethree = 1, bakingsoda = 1}, give = {loosecokestagethree = 7}}, + }, + bagcoke = { + tier1 = {take = {loosecoke = 7, empty_bag = 7}, give = {cokebaggy = 7}}, + tier2 = {take = {loosecokestagetwo = 7, empty_bag = 7}, give = {cokebaggystagetwo = 7}}, + tier3 = {take = {loosecokestagethree = 7, empty_bag = 7}, give = {cokebaggystagethree = 7}}, } }, - heroin = { - dryheroin = { - tier1 = {take = {poppyresin = 1}, give = {heroin = 1}}, - tier2 = {take = {poppyresin = 1}, give = {heroinstagetwo = 1}}, - tier3 = {take = {poppyresin = 1}, give = {heroinstagethree = 1}}, - }, - cutheroin = { - tier1 = {take = {heroin = 1, bakingsoda = 1}, give = {heroincut = 1}}, - tier2 = {take = {heroinstagetwo = 1, bakingsoda = 1}, give = {heroincutstagetwo = 1}}, - tier3 = {take = {heroinstagethree = 1, bakingsoda = 1}, give = {heroincutstagethree = 1}}, - }, - fillvial = { - tier1 = {take = {heroincut = 1, emptyvial = 1}, give = {heroinvial = 1}}, - tier2 = {take = {heroincutstagetwo = 1, emptyvial = 1}, give = {heroinvialstagetwo = 1}}, - tier3 = {take = {heroincutstagethree = 1, emptyvial = 1}, give = {heroinvialstagethree = 1}}, - }, - fillneedle = { - tier1 = {take = {heroinvial = 1, needle = 1}, give = {heroin_ready = 1}}, - tier2 = {take = {heroin_readystagetwo = 1, needle = 1}, give = {heroin_readystagetwo = 1}}, - tier3 = {take = {heroinvialstagethree = 1, needle = 1}, give = {heroin_readystagethree = 1}}, - } + crack = { + cookcrack = { + tier1 = {take = {loosecoke = 7, bakingsoda = 1}, give = {crackrock = 1}}, + tier2 = {take = {loosecokestagetwo = 7, bakingsoda = 1}, give = {crackrockstagetwo = 1}}, + tier3 = {take = {loosecokestagethree = 7,bakingsoda = 1}, give = {crackrockstagethree = 1}}, + }, + bagcrack = { + tier1 = {take = {crackrock = 1, empty_bag = 9}, give = {baggedcracked = 10}}, + tier2 = {take = {crackrockstagetwo = 1, empty_bag = 9}, give = {baggedcrackedstagetwo = 10}}, + tier3 = {take = {crackrockstagethree = 1, empty_bag = 9}, give = {baggedcrackedstagethree = 10}}, + } + }, + heroin = { + dryheroin = { + tier1 = {take = {poppyresin = 6}, give = {heroin = 1}}, + tier2 = {take = {poppyresin = 6}, give = {heroinstagetwo = 1}}, + tier3 = {take = {poppyresin = 6}, give = {heroinstagethree = 1}}, + }, + cutheroin = { + tier1 = {take = {heroin = 1, bakingsoda = 1}, give = {heroincut = 1}}, + tier2 = {take = {heroinstagetwo = 1, bakingsoda = 1}, give = {heroincutstagetwo = 1}}, + tier3 = {take = {heroinstagethree = 1, bakingsoda = 1}, give = {heroincutstagethree = 1}}, + }, + fillvial = { + tier1 = {take = {heroincut = 1, emptyvial = 1}, give = {heroinvial = 1}}, + tier2 = {take = {heroincutstagetwo = 1, emptyvial = 1}, give = {heroinvialstagetwo = 1}}, + tier3 = {take = {heroincutstagethree = 1, emptyvial = 1}, give = {heroinvialstagethree = 1}}, + }, + fillneedle = { + tier1 = {take = {heroinvial = 1, needle = 14}, give = {heroin_ready = 14}}, + tier2 = {take = {heroin_readystagetwo = 1, needle = 14}, give = {heroin_readystagetwo = 14}}, + tier3 = {take = {heroinvialstagethree = 1, needle = 14}, give = {heroin_readystagethree = 14}}, + } + }, + lsd = { + vial = { + heat = {take = {lysergic_acid = 1, diethylamide = 1,}, give = {lsd_one_vial = 2}} + }, + + }, + mescaline = { + dry = { + dried = {take = {cactusbulb = 1}, give = {driedmescaline = 2} } + } }, - lsd = { - vial = { - heat = {take = {lysergic_acid = 1, diethylamide = 1,}, give = {lsd_one_vial = 1}} - }, - + lean = { + cups = { + cupoflean = {take = {leancup = 1, sprunk = 1, mdlean = 1}, give = {cupoflean = 2}}, + cupofdextro = {take = {leancup = 1, sprunk = 1, mdreddextro = 1}, give = {cupofdextro = 2}}, + } }, - mescaline = { - dry = { - dried = {take = {cactusbulb = 1}, give = {driedmescaline = 1} } - } - }, - lean = { - cups = { - cupoflean = {take = {leancup = 1, sprunk = 1, mdlean = 1}, give = {cupoflean = 1}}, - cupofdextro = {take = {leancup = 1, sprunk = 1, mdreddextro = 1}, give = {cupofdextro = 1}}, - } - }, - meth = { - cook = { - heat = {take = {ephedrine = 1, acetone = 1}, give = {}} - }, - bag = { - bags = {take = {empty_weed_bag = 5}, give = {methbags = 5} } - } - }, - weed = { - edibles = { - cannabutter = {take = { mdbutter = 1, grindedweed = 1}, give = {cannabutter = 1}}, - specialbrownie = {take = { cannabutter = 1, flour = 1, chocolate = 1}, give = {specialbrownie = 1}}, - specialcookie = { take = { cannabutter = 1, flour = 1}, give = {specialcookie = 1}}, - specialchocolate = { take = { cannabutter = 1, chocolate = 1}, give = {specialchocolate = 1}}, - specialmuffin = { take = { cannabutter = 1, flour = 1}, give = {specialmuffin = 1}}, - }, - oil = { - shatter = {take = {butane = 1, grindedweed = 1}, give = {shatter = 1}} - }, - blunts = { - blunt = {take = {bluntwrap = 1, grindedweed = 1}, give = {blunt = 1}}, - chewyblunt = {take = {bluntwrap = 1, grindedweed = 1, loosecoke = 1}, give = {chewyblunt = 1}}, - leanblunts = {take = {leanbluntwrap = 1, grindedweed = 1}, give = {leanblunts = 1}}, - dextroblunts = {take = {dextrobluntwrap = 1, grindedweed = 1}, give = {dextroblunts = 1}} - }, - bluntwrap = { - leanbluntwrap = {take = {bluntwrap = 5, mdlean = 1}, give = {leanbluntwrap = 5}}, - dextrobluntwrap = {take = {bluntwrap = 5, mdreddextro = 1}, give = {dextrobluntwrap = 5}}, - } - }, - xtc = { - raw = { - raw_xtc = {take = {mdp2p = 1, isosafrole = 1}, give = {raw_xtc = 1}} - }, - singlestack = { - white = {take = {raw_xtc = 1}, give = {white_xtc = 1}}, - red = {take = {raw_xtc = 1, loosecoke = 1 }, give = {red_xtc = 1}}, - orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc = 1}}, - blue = {take = {raw_xtc = 1, crackrock = 1 }, give = {blue_xtc = 1}}, - }, - dualstack = { - white = {take = {raw_xtc = 1}, give = {white_xtc2 = 1}}, - red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc2 = 1}}, - orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc2 = 1}}, - blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc2 = 1}}, - }, - triplestack = { - white = {take = {raw_xtc = 1}, give = {white_xtc3 = 1}}, - red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc3 = 1}}, - orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc3 = 1}}, - blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc3 = 1}}, - }, - quadstack = { - white = {take = {raw_xtc = 1}, give = {white_xtc4 = 1}}, - red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc4 = 1}}, - orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc4 = 1}}, - blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc4 = 1}}, - }, - press = { - dual = {take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}, give = {dualpress = 1}}, - triple = {take = {white_xtc2 = 50, blue_xtc2 = 50, red_xtc2 = 50, orange_xtc2 = 50, dualpress = 1}, give = {triplepres = 1}}, - quad = { take = {white_xtc3 = 50, blue_xtc3 = 50, red_xtc3 = 50, orange_xtc3 = 50, triplepress = 1}, give = {quadpress = 1}} - } - } + meth = { + cook = { + heat = {take = {ephedrine = 1, acetone = 1}, give = {}} + }, + bag = { + bags = {take = {empty_bag = 15}, give = {methbags = 15} } + } + }, + weed = { + edibles = { + cannabutter = {take = { mdbutter = 1, grindedweed = 5}, give = {cannabutter = 2}}, + specialbrownie = {take = { cannabutter = 1, flour = 1, chocolate = 1}, give = {specialbrownie = 5}}, + specialcookie = { take = { cannabutter = 1, flour = 1}, give = {specialcookie = 3}}, + specialchocolate = { take = { cannabutter = 1, chocolate = 1}, give = {specialchocolate = 2}}, + specialmuffin = { take = { cannabutter = 1, flour = 1}, give = {specialmuffin = 3}}, + }, + oil = { + shatter = {take = {butane = 1, grindedweed = 20}, give = {shatter = 10}} + }, + blunts = { + blunt = {take = {bluntwrap = 2, grindedweed = 1}, give = {blunt = 2}}, + chewyblunt = {take = {bluntwrap = 2, grindedweed = 1, loosecoke = 1}, give = {chewyblunt = 2}}, + leanblunts = {take = {leanbluntwrap = 2, grindedweed = 1}, give = {leanblunts = 2}}, + dextroblunts = {take = {dextrobluntwrap = 2, grindedweed = 1}, give = {dextroblunts = 2}} + }, + bluntwrap = { + leanbluntwrap = {take = {bluntwrap = 5, mdlean = 1}, give = {leanbluntwrap = 5}}, + dextrobluntwrap = {take = {bluntwrap = 5, mdreddextro = 1}, give = {dextrobluntwrap = 5}}, + } + }, + xtc = { + raw = { + raw_xtc = {take = {mdp2p = 1, isosafrole = 1}, give = {raw_xtc = 1}} + }, + singlestack = { + white = {take = {raw_xtc = 1}, give = {white_xtc = 1}}, + red = {take = {raw_xtc = 1, loosecoke = 1 }, give = {red_xtc = 1}}, + orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc = 1}}, + blue = {take = {raw_xtc = 1, crackrock = 1 }, give = {blue_xtc = 1}}, + }, + dualstack = { + white = {take = {raw_xtc = 1}, give = {white_xtc2 = 1}}, + red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc2 = 1}}, + orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc2 = 1}}, + blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc2 = 1}}, + }, + triplestack = { + white = {take = {raw_xtc = 1}, give = {white_xtc3 = 1}}, + red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc3 = 1}}, + orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc3 = 1}}, + blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc3 = 1}}, + }, + quadstack = { + white = {take = {raw_xtc = 1}, give = {white_xtc4 = 1}}, + red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc4 = 1}}, + orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc4 = 1}}, + blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc4 = 1}}, + }, + press = { + dual = {take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}, give = {dualpress = 1}}, + triple = {take = {white_xtc2 = 50, blue_xtc2 = 50, red_xtc2 = 50, orange_xtc2 = 50, dualpress = 1}, give = {triplepres = 1}}, + quad = { take = {white_xtc3 = 50, blue_xtc3 = 50, red_xtc3 = 50, orange_xtc3 = 50, triplepress = 1}, give = {quadpress = 1}} + } + } } function GetRecipe(source, type, method, tier) diff --git a/server/weed.lua b/server/weed.lua index 31b4afb..7958cb3 100644 --- a/server/weed.lua +++ b/server/weed.lua @@ -1,7 +1,7 @@ local QBCore = exports['qb-core']:GetCoreObject() local weedPlant = { - { location = vector3(1049.63, -3202.12, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.63, -3202.12, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"}, { location = vector3(1050.85, -3202.15, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"}, { location = vector3(1052.01, -3202.22, -39.13), heading = 25.16, model = "bkr_prop_weed_lrg_01b"}, { location = vector3(1052.99, -3202.15, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"}, diff --git a/shared/config.lua b/shared/config.lua index ae87a56..143acfc 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -1,13 +1,13 @@ Config = {} --Ignore. -Config.Target = 'interact' -- qb or ox -Config.respawnTime = 10 -- Seconds -Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn-fuel, LegacyFuel +Config.Target = 'ox' -- qb or ox +Config.respawnTime = 600 -- Seconds +Config.Fuel = "ps-fuel" -- 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.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total Config.RequestModelTime = 30000 -- if you need more time than this, uhhhh wow -Config.minigametype = 'ox' -- look above for options or choose none if you dont want any minigames -Config.FancyCokeAnims = false -- if you want multi location this needs to be false + +Config.FancyCokeAnims = true -- if you want multi location this needs to be false Config.PharmaJob = "ems" -- what TYPE role you need to be on to get the command Config.Joblock = false -- if you want weed to be a job Config.weedjob = "" -- what the job name is @@ -47,9 +47,4 @@ Config.Minigames = { glspot = {gridSize = 6, timeLimit = 999999, charSet = "alphabet", required = 10}, glmath = {timeLimit = 300000}, } - - ---- TODO: Move these to server files -Config.tabcost = 100 -- price per piece of tab paper event does 10 at a time -Config.lsdlabkitcost = 10000 -- price of the lsd lab kit -Config.heroinlabkitprice = 10000 -- price of the lsd lab kit +Config.minigametype = 'blrapidlines' -- look above for options or choose none if you dont want any minigames \ No newline at end of file From 6df098327397b07830bbc3a0d78db90258efe394 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:27:30 -0800 Subject: [PATCH 11/36] patch --- client/target.lua | 4 +- server/locations.lua | 8 +- server/recipes.lua | 252 +++++++++++++++++++++---------------------- 3 files changed, 132 insertions(+), 132 deletions(-) diff --git a/client/target.lua b/client/target.lua index bfaede9..e185b0f 100644 --- a/client/target.lua +++ b/client/target.lua @@ -4,8 +4,8 @@ local icon = "fa solid fa-eye" CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) if not config then return end - AddBoxZoneSingle('telecokein', config.singleSpot.CokeTeleIn, {action = function()tele(config.singelSpot.CokeTeleOut)end, icon = 'fa-solid fa-door-open', label = Lang.targets.coke.enter}) -- coke - AddBoxZoneSingle('telecokeout', config.singleSpot.CokeTeleOut, {action = function()tele(config.singelSpot.CokeTeleIn) end, icon = "fa-solid fa-door-closed", label = Lang.targets.coke.exit}) -- coke + 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 = icon, label = Lang.targets.lsd.lys}) -- lsd AddBoxZoneMulti('stealdiethylamide', config.diethylamide, {event = "md-drugs:client:getdiethylamide", icon = icon, label = Lang.targets.lsd.die}) -- lsd diff --git a/server/locations.lua b/server/locations.lua index 0311975..89adb4e 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -11,7 +11,7 @@ local Target = { {loc = vector3(1093.16, -3195.78, -39.19), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, makecrack = { -- make crack with baking soda with cut coke 1-3 - {loc = vector3(2434.07, 4969.39, 42.35), 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 = ""}, }, bagcrack = { --- bag crack 1-3 stages {loc = vector3(2436.55, 4964.96, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, @@ -92,8 +92,8 @@ local Target = { }, Travellingmerchant = { -- where the travelling merchant can spawn vector4(-119.66, -977.43, 304.25, 88.21), - vector4(-1522.93, 1476.01, 111.45, 41.25), - vector4(-3278.98, 973.38, 5.35, 101.53), + vector4(-1522.93, 1476.01, 111.45, 41.25), + vector4(-3278.98, 973.38, 5.35, 101.53), }, oxylocations = { vector4(-2352.32, 266.78, 165.3, 23.46), @@ -135,4 +135,4 @@ lib.callback.register('md-drugs:server:getLocs', function() end) lib.callback.register('md-drugs:server:GetMerchant', function(source) return loc -end) +end) \ No newline at end of file diff --git a/server/recipes.lua b/server/recipes.lua index 42ba93a..361ba0b 100644 --- a/server/recipes.lua +++ b/server/recipes.lua @@ -2,137 +2,137 @@ local QBCore = exports['qb-core']:GetCoreObject() local recipe = { cocaine = { - cokepowder = { - tier1 = {take = {coca_leaf = 8}, give = {coke = 1}}, - tier2 = {take = {coca_leaf = 8}, give = {cokestagetwo = 1}}, - tier3 = {take = {coca_leaf = 8}, give = {cokestagethree = 1}}, + cokepowder = { + tier1 = {take = {coca_leaf = 1}, give = {coke = 1}}, + tier2 = {take = {coca_leaf = 1}, give = {cokestagetwo = 1}}, + tier3 = {take = {coca_leaf = 1}, give = {cokestagethree = 1}}, + }, + cutcoke = { + tier1 = {take = {coke = 1, bakingsoda = 1}, give = {loosecoke = 1}}, + tier2 = {take = {cokestagetwo = 1, bakingsoda = 1}, give = {loosecokestagetwo = 1}}, + tier3 = {take = {cokestagethree = 1, bakingsoda = 1}, give = {loosecokestagethree = 1}}, + }, + bagcoke = { + tier1 = {take = {loosecoke = 1, empty_weed_bag = 1}, give = {cokebaggy = 1}}, + tier2 = {take = {loosecokestagetwo = 1, empty_weed_bag = 1}, give = {cokebaggystagetwo = 1}}, + tier3 = {take = {loosecokestagethree = 1, empty_weed_bag = 1}, give = {cokebaggystagethree = 1}}, + } + }, + crack = { + cookcrack = { + tier1 = {take = {loosecoke = 1, bakingsoda = 1}, give = {crackrock = 1}}, + tier2 = {take = {loosecokestagetwo = 1, bakingsoda = 1}, give = {crackrockstagetwo = 1}}, + tier3 = {take = {loosecokestagethree = 1,bakingsoda = 1}, give = {crackrockstagethree = 1}}, }, - cutcoke = { - tier1 = {take = {coke = 1, bakingsoda = 1}, give = {loosecoke = 7}}, - tier2 = {take = {cokestagetwo = 1, bakingsoda = 1}, give = {loosecokestagetwo = 7}}, - tier3 = {take = {cokestagethree = 1, bakingsoda = 1}, give = {loosecokestagethree = 7}}, - }, - bagcoke = { - tier1 = {take = {loosecoke = 7, empty_bag = 7}, give = {cokebaggy = 7}}, - tier2 = {take = {loosecokestagetwo = 7, empty_bag = 7}, give = {cokebaggystagetwo = 7}}, - tier3 = {take = {loosecokestagethree = 7, empty_bag = 7}, give = {cokebaggystagethree = 7}}, + bagcrack = { + tier1 = {take = {crackrock = 1, empty_weed_bag = 1}, give = {baggedcracked = 1}}, + tier2 = {take = {crackrockstagetwo = 1, empty_weed_bag = 1}, give = {baggedcrackedstagetwo = 1}}, + tier3 = {take = {crackrockstagethree = 1, empty_weed_bag = 1}, give = {baggedcrackedstagethree = 1}}, } }, - crack = { - cookcrack = { - tier1 = {take = {loosecoke = 7, bakingsoda = 1}, give = {crackrock = 1}}, - tier2 = {take = {loosecokestagetwo = 7, bakingsoda = 1}, give = {crackrockstagetwo = 1}}, - tier3 = {take = {loosecokestagethree = 7,bakingsoda = 1}, give = {crackrockstagethree = 1}}, - }, - bagcrack = { - tier1 = {take = {crackrock = 1, empty_bag = 9}, give = {baggedcracked = 10}}, - tier2 = {take = {crackrockstagetwo = 1, empty_bag = 9}, give = {baggedcrackedstagetwo = 10}}, - tier3 = {take = {crackrockstagethree = 1, empty_bag = 9}, give = {baggedcrackedstagethree = 10}}, - } - }, - heroin = { - dryheroin = { - tier1 = {take = {poppyresin = 6}, give = {heroin = 1}}, - tier2 = {take = {poppyresin = 6}, give = {heroinstagetwo = 1}}, - tier3 = {take = {poppyresin = 6}, give = {heroinstagethree = 1}}, - }, - cutheroin = { - tier1 = {take = {heroin = 1, bakingsoda = 1}, give = {heroincut = 1}}, - tier2 = {take = {heroinstagetwo = 1, bakingsoda = 1}, give = {heroincutstagetwo = 1}}, - tier3 = {take = {heroinstagethree = 1, bakingsoda = 1}, give = {heroincutstagethree = 1}}, - }, - fillvial = { - tier1 = {take = {heroincut = 1, emptyvial = 1}, give = {heroinvial = 1}}, - tier2 = {take = {heroincutstagetwo = 1, emptyvial = 1}, give = {heroinvialstagetwo = 1}}, - tier3 = {take = {heroincutstagethree = 1, emptyvial = 1}, give = {heroinvialstagethree = 1}}, - }, - fillneedle = { - tier1 = {take = {heroinvial = 1, needle = 14}, give = {heroin_ready = 14}}, - tier2 = {take = {heroin_readystagetwo = 1, needle = 14}, give = {heroin_readystagetwo = 14}}, - tier3 = {take = {heroinvialstagethree = 1, needle = 14}, give = {heroin_readystagethree = 14}}, - } - }, - lsd = { - vial = { - heat = {take = {lysergic_acid = 1, diethylamide = 1,}, give = {lsd_one_vial = 2}} - }, - - }, - mescaline = { - dry = { - dried = {take = {cactusbulb = 1}, give = {driedmescaline = 2} } - } + heroin = { + dryheroin = { + tier1 = {take = {poppyresin = 1}, give = {heroin = 1}}, + tier2 = {take = {poppyresin = 1}, give = {heroinstagetwo = 1}}, + tier3 = {take = {poppyresin = 1}, give = {heroinstagethree = 1}}, + }, + cutheroin = { + tier1 = {take = {heroin = 1, bakingsoda = 1}, give = {heroincut = 1}}, + tier2 = {take = {heroinstagetwo = 1, bakingsoda = 1}, give = {heroincutstagetwo = 1}}, + tier3 = {take = {heroinstagethree = 1, bakingsoda = 1}, give = {heroincutstagethree = 1}}, + }, + fillvial = { + tier1 = {take = {heroincut = 1, emptyvial = 1}, give = {heroinvial = 1}}, + tier2 = {take = {heroincutstagetwo = 1, emptyvial = 1}, give = {heroinvialstagetwo = 1}}, + tier3 = {take = {heroincutstagethree = 1, emptyvial = 1}, give = {heroinvialstagethree = 1}}, + }, + fillneedle = { + tier1 = {take = {heroinvial = 1, needle = 1}, give = {heroin_ready = 1}}, + tier2 = {take = {heroin_readystagetwo = 1, needle = 1}, give = {heroin_readystagetwo = 1}}, + tier3 = {take = {heroinvialstagethree = 1, needle = 1}, give = {heroin_readystagethree = 1}}, + } }, - lean = { - cups = { - cupoflean = {take = {leancup = 1, sprunk = 1, mdlean = 1}, give = {cupoflean = 2}}, - cupofdextro = {take = {leancup = 1, sprunk = 1, mdreddextro = 1}, give = {cupofdextro = 2}}, - } + lsd = { + vial = { + heat = {take = {lysergic_acid = 1, diethylamide = 1,}, give = {lsd_one_vial = 1}} + }, + }, - meth = { - cook = { - heat = {take = {ephedrine = 1, acetone = 1}, give = {}} - }, - bag = { - bags = {take = {empty_bag = 15}, give = {methbags = 15} } - } - }, - weed = { - edibles = { - cannabutter = {take = { mdbutter = 1, grindedweed = 5}, give = {cannabutter = 2}}, - specialbrownie = {take = { cannabutter = 1, flour = 1, chocolate = 1}, give = {specialbrownie = 5}}, - specialcookie = { take = { cannabutter = 1, flour = 1}, give = {specialcookie = 3}}, - specialchocolate = { take = { cannabutter = 1, chocolate = 1}, give = {specialchocolate = 2}}, - specialmuffin = { take = { cannabutter = 1, flour = 1}, give = {specialmuffin = 3}}, - }, - oil = { - shatter = {take = {butane = 1, grindedweed = 20}, give = {shatter = 10}} - }, - blunts = { - blunt = {take = {bluntwrap = 2, grindedweed = 1}, give = {blunt = 2}}, - chewyblunt = {take = {bluntwrap = 2, grindedweed = 1, loosecoke = 1}, give = {chewyblunt = 2}}, - leanblunts = {take = {leanbluntwrap = 2, grindedweed = 1}, give = {leanblunts = 2}}, - dextroblunts = {take = {dextrobluntwrap = 2, grindedweed = 1}, give = {dextroblunts = 2}} - }, - bluntwrap = { - leanbluntwrap = {take = {bluntwrap = 5, mdlean = 1}, give = {leanbluntwrap = 5}}, - dextrobluntwrap = {take = {bluntwrap = 5, mdreddextro = 1}, give = {dextrobluntwrap = 5}}, - } - }, - xtc = { - raw = { - raw_xtc = {take = {mdp2p = 1, isosafrole = 1}, give = {raw_xtc = 1}} - }, - singlestack = { - white = {take = {raw_xtc = 1}, give = {white_xtc = 1}}, - red = {take = {raw_xtc = 1, loosecoke = 1 }, give = {red_xtc = 1}}, - orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc = 1}}, - blue = {take = {raw_xtc = 1, crackrock = 1 }, give = {blue_xtc = 1}}, - }, - dualstack = { - white = {take = {raw_xtc = 1}, give = {white_xtc2 = 1}}, - red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc2 = 1}}, - orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc2 = 1}}, - blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc2 = 1}}, - }, - triplestack = { - white = {take = {raw_xtc = 1}, give = {white_xtc3 = 1}}, - red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc3 = 1}}, - orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc3 = 1}}, - blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc3 = 1}}, - }, - quadstack = { - white = {take = {raw_xtc = 1}, give = {white_xtc4 = 1}}, - red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc4 = 1}}, - orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc4 = 1}}, - blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc4 = 1}}, - }, - press = { - dual = {take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}, give = {dualpress = 1}}, - triple = {take = {white_xtc2 = 50, blue_xtc2 = 50, red_xtc2 = 50, orange_xtc2 = 50, dualpress = 1}, give = {triplepres = 1}}, - quad = { take = {white_xtc3 = 50, blue_xtc3 = 50, red_xtc3 = 50, orange_xtc3 = 50, triplepress = 1}, give = {quadpress = 1}} - } - } + mescaline = { + dry = { + dried = {take = {cactusbulb = 1}, give = {driedmescaline = 1} } + } + }, + lean = { + cups = { + cupoflean = {take = {leancup = 1, sprunk = 1, mdlean = 1}, give = {cupoflean = 1}}, + cupofdextro = {take = {leancup = 1, sprunk = 1, mdreddextro = 1}, give = {cupofdextro = 1}}, + } + }, + meth = { + cook = { + heat = {take = {ephedrine = 1, acetone = 1}, give = {}} + }, + bag = { + bags = {take = {empty_weed_bag = 5}, give = {methbags = 5} } + } + }, + weed = { + edibles = { + cannabutter = {take = { mdbutter = 1, grindedweed = 1}, give = {cannabutter = 1}}, + specialbrownie = {take = { cannabutter = 1, flour = 1, chocolate = 1}, give = {specialbrownie = 1}}, + specialcookie = { take = { cannabutter = 1, flour = 1}, give = {specialcookie = 1}}, + specialchocolate = { take = { cannabutter = 1, chocolate = 1}, give = {specialchocolate = 1}}, + specialmuffin = { take = { cannabutter = 1, flour = 1}, give = {specialmuffin = 1}}, + }, + oil = { + shatter = {take = {butane = 1, grindedweed = 1}, give = {shatter = 1}} + }, + blunts = { + blunt = {take = {bluntwrap = 1, grindedweed = 1}, give = {blunt = 1}}, + chewyblunt = {take = {bluntwrap = 1, grindedweed = 1, loosecoke = 1}, give = {chewyblunt = 1}}, + leanblunts = {take = {leanbluntwrap = 1, grindedweed = 1}, give = {leanblunts = 1}}, + dextroblunts = {take = {dextrobluntwrap = 1, grindedweed = 1}, give = {dextroblunts = 1}} + }, + bluntwrap = { + leanbluntwrap = {take = {bluntwrap = 5, mdlean = 1}, give = {leanbluntwrap = 5}}, + dextrobluntwrap = {take = {bluntwrap = 5, mdreddextro = 1}, give = {dextrobluntwrap = 5}}, + } + }, + xtc = { + raw = { + raw_xtc = {take = {mdp2p = 1, isosafrole = 1}, give = {raw_xtc = 1}} + }, + singlestack = { + white = {take = {raw_xtc = 1}, give = {white_xtc = 1}}, + red = {take = {raw_xtc = 1, loosecoke = 1 }, give = {red_xtc = 1}}, + orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc = 1}}, + blue = {take = {raw_xtc = 1, crackrock = 1 }, give = {blue_xtc = 1}}, + }, + dualstack = { + white = {take = {raw_xtc = 1}, give = {white_xtc2 = 1}}, + red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc2 = 1}}, + orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc2 = 1}}, + blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc2 = 1}}, + }, + triplestack = { + white = {take = {raw_xtc = 1}, give = {white_xtc3 = 1}}, + red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc3 = 1}}, + orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc3 = 1}}, + blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc3 = 1}}, + }, + quadstack = { + white = {take = {raw_xtc = 1}, give = {white_xtc4 = 1}}, + red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc4 = 1}}, + orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc4 = 1}}, + blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc4 = 1}}, + }, + press = { + dual = {take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}, give = {dualpress = 1}}, + triple = {take = {white_xtc2 = 50, blue_xtc2 = 50, red_xtc2 = 50, orange_xtc2 = 50, dualpress = 1}, give = {triplepres = 1}}, + quad = { take = {white_xtc3 = 50, blue_xtc3 = 50, red_xtc3 = 50, orange_xtc3 = 50, triplepress = 1}, give = {quadpress = 1}} + } + } } function GetRecipe(source, type, method, tier) From c2fddd6144431085aee34224753c76910c1a30e2 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Fri, 22 Nov 2024 01:35:25 -0800 Subject: [PATCH 12/36] update made server table for presses, will do same for lab kits --- client/xtc.lua | 24 +++++++ server/cocaine.lua | 4 -- server/crack.lua | 2 - server/deliveries.lua | 9 +-- server/functions.lua | 32 --------- server/heroin.lua | 20 ------ server/locations.lua | 2 + server/lsd.lua | 10 +-- server/mescaline.lua | 2 - server/recipes.lua | 3 +- server/xtc.lua | 150 +++++++++++++++--------------------------- 11 files changed, 85 insertions(+), 173 deletions(-) diff --git a/client/xtc.lua b/client/xtc.lua index 1e85087..bb13a2f 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -23,6 +23,30 @@ RegisterNetEvent("md-drugs:client:setpress", function(type) end end) +lib.callback.register('md-drugs:client:setpress', function(type) + if xtcpress then + Notify(Lang.xtc.out, 'error') + return false +else + local coords, head = StartRay2() + xtcpress = true + progressbar('Setting Press On The Ground', 4000, 'uncuff') + local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false) + PlaceObjectOnGroundProperly(press) + Freeze(press, true, head) + local options = { + { icon = "fas fa-eye", label = Lang.targets.xtc.make, distance = 2.0, action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end, + canInteract = function() if xtcpress then return true end end + }, + {icon = "fas fa-eye", label = Lang.targets.xtc.pick, action = function() TriggerEvent("md-drugs:client:GetPressBack", type, press) end, distance = 2.0, + canInteract = function() if xtcpress then return true end end + }, + } + AddMultiModel(press, options, nil) + return true, GetEntityCoords(press) +end +end) + RegisterNetEvent("md-drugs:client:XTCMenu", function(type) local event = "md-drugs:client:MakeXTC" lib.registerContext({ diff --git a/server/cocaine.lua b/server/cocaine.lua index 8677c49..8069aec 100644 --- a/server/cocaine.lua +++ b/server/cocaine.lua @@ -45,7 +45,6 @@ AddEventHandler("coke:pickupCane", function(loc) TriggerClientEvent("coke:removeCane", -1, loc) CaneCooldown(loc) AddItem(src, 'coca_leaf', 1) - --Log(GetName(src) .. ' Picked A Coca Leaf With a distance of ' .. dist(src, Config.CocaPlant[loc].location) .. ' vectors', 'coke') end end) @@ -65,7 +64,6 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num) end end if not GetRecipe(src, 'cocaine', 'cokepowder', tier) then return end - Log(GetName(src) .. logMessage .. dist(src, Config.MakePowder[num]['loc']) .. ' vectors', 'coke') end) RegisterServerEvent('md-drugs:server:cutcokeone', function(num) @@ -94,7 +92,6 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function(num) if not GetRecipe(src, 'cocaine', 'cutcoke', tier) then return end else if not GetRecipe(src, 'cocaine', 'cutcoke', 'tier1') then return end - Log(GetName(src) .. ' Cut Coke', 'coke') end end) @@ -126,7 +123,6 @@ RegisterServerEvent('md-drugs:server:bagcoke', function(num) AddRep(src, 'coke') else if not GetRecipe(src, 'cocaine', 'bagcoke', 'tier1') then return end - Log(GetName(src) .. ' Bagged Coke', 'coke') end end) diff --git a/server/crack.lua b/server/crack.lua index a800fdd..e33d313 100644 --- a/server/crack.lua +++ b/server/crack.lua @@ -16,7 +16,6 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num) if Player.Functions.GetItemByName(v.item) then tier = v.tier count = count + 1 - Log(GetName(src) .. v.log, 'crack') end end end @@ -40,7 +39,6 @@ RegisterServerEvent('md-drugs:server:bagcrack', function(num) if Player.Functions.GetItemByName(v.item) then tier = v.tier count = count + 1 - Log(GetName(src) .. v.log, 'crack') end end end diff --git a/server/deliveries.lua b/server/deliveries.lua index c8429d5..2c80f91 100644 --- a/server/deliveries.lua +++ b/server/deliveries.lua @@ -80,9 +80,6 @@ lib.addCommand("newdealer", { if not Player then return end local dealerName = args.name - local minTime = args.min - local maxTime = args.max - local time = json.encode({min = minTime, max = maxTime}) local pos = json.encode({x = coords.x, y = coords.y, z = coords.z}) local result = MySQL.scalar.await('SELECT name FROM dealers WHERE name = ?', { dealerName }) @@ -91,7 +88,7 @@ lib.addCommand("newdealer", { end MySQL.insert('INSERT INTO dealers (name, coords, time, createdby) VALUES (?, ?, ?, ?)', { - dealerName, pos, time, Player.PlayerData.citizenid + dealerName, pos, 'nil', Player.PlayerData.citizenid }, function() QBConfig.Dealers[dealerName] = { name = dealerName, @@ -101,10 +98,6 @@ lib.addCommand("newdealer", { z = coords.z, h = GetEntityHeading(ped) }, - time = { - min = minTime, - max = maxTime - }, } TriggerClientEvent('md-drugs:client:RefreshDealers', -1, QBConfig.Dealers) end) diff --git a/server/functions.lua b/server/functions.lua index 0b0494e..aa1ca60 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -318,38 +318,6 @@ function sortTab(tbl, type) end) end -function ChecknRemove(source, table) - local Player = getPlayer(source) - local hass = 0 - local need = 0 - for k, v in pairs (table) do - need = need + 1 - if inventory == 'qb' then - local itemchecks = Player.Functions.GetItemByName(k) - if itemchecks and itemchecks.amount >= v then - hass = hass + 1 - else - Notifys(source, 'You Need ' .. v .. ' Of ' .. GetLabels(k) .. ' To Do this', 'error') - end - elseif inventory == 'ox' then - local items = exports.ox_inventory:GetItem(source, k, nil, false) - if items.count >= v then - hass = hass + 1 - else - Notifys(source, 'You Need ' .. v .. ' Of ' .. GetLabels(k) .. ' To Do This', 'error') - end - end - end - if hass == need then - for k, v in pairs (table) do - RemoveItem(source, k, v) - end - return true - else - return false - end -end - lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args) local amount = 0 local players = QBCore.Functions.GetQBPlayers() diff --git a/server/heroin.lua b/server/heroin.lua index a4bf794..f899221 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -54,7 +54,6 @@ RegisterServerEvent("heroin:pickupCane", function(loc) TriggerClientEvent("heroin:removeCane", -1, loc) heroinCooldown(loc) AddItem(source, 'poppyresin', 1) - Log(GetName(source) .. ' Picked A Poppies With a distance of ' .. dist(source, h[loc].location) .. ' vectors', 'heroin') end end) @@ -66,17 +65,13 @@ RegisterServerEvent('md-drugs:server:dryplant', function(num) local heroin = getRep(src, 'heroin') if heroin <= Config.Tier1 then if not GetRecipe(src, 'heroin', 'dryheroin', 'tier1') then return end - Log(GetName(src) ..' Made Heroin Powder', 'heroin') elseif heroin >= Config.Tier1 and heroin <= Config.Tier2 then if not GetRecipe(src, 'heroin', 'dryheroin', 'tier2') then return end - Log(GetName(src) ..' Made Heroin Powder Tier 2', 'heroin') else if not GetRecipe(src, 'heroin', 'dryheroin', 'tier3') then return end - Log(GetName(src) ..' Made Heroin Powder Tier 3', 'heroin') end else if not GetRecipe(src, 'heroin', 'dryheroin', 'tier1') then return end - Log(GetName(src) ..' Made Heroin Powder With a distance of', 'heroin') end end) @@ -92,19 +87,15 @@ RegisterServerEvent('md-drugs:server:cutheroin', function(num) local rawh3 = Player.Functions.GetItemByName('heroinstagethree') if rawh then if not GetRecipe(src, 'heroin', 'cutheroin', 'tier1') then return end - Log(GetName(src) ..' Cut Heroin With a distance of', 'heroin') elseif rawh2 then if not GetRecipe(src, 'heroin', 'cutheroin', 'tier2') then return end - Log(GetName(src) ..' Cut Heroin Tier 2 With a distance of', 'heroin') elseif rawh3 then if not GetRecipe(src, 'heroin', 'cutheroin', 'tier3') then return end - Log(GetName(src) .. ' Cut Heroin Tier 3 With a distance of', 'heroin') else Notifys(src, Lang.Heroin.noheroin, "error") end else if not GetRecipe(src, 'heroin', 'cutheroin', 'tier1') then return end - Log(GetName(src) ..' Cut Heroin With a distance of', 'heroin') end end) @@ -114,7 +105,6 @@ RegisterServerEvent('md-drugs:server:getheroinlabkit', function() if not checkLoc(source, 'singleSpot', 'buyheroinlabkit') then return end if Player.Functions.RemoveMoney('cash', prices.heroinlabkitprice) then AddItem(src, 'heroinlabkit', 1) - Log(GetName(src) ..' Bought A Heroin lab Kit', 'heroin') else Notifys(src, 'You Need '.. prices.heroinlabkitprice .. ' In Cash For This', 'error') end @@ -124,7 +114,6 @@ RegisterServerEvent('md-drugs:server:getheroinlabkitback', function() local src = source local Player = getPlayer(src) if AddItem(src, "heroinlabkit", 1) then - Log(GetName(src) ..' Picked Up Their Heroin Lab Kit Back At ' .. GetCoords(src) .. '!', 'heroin') end end) @@ -150,19 +139,15 @@ local Player = getPlayer(src) local cuth3 = Player.Functions.GetItemByName('heroincutstagethree') if cuth then if not GetRecipe(src, 'heroin', 'fillvial', 'tier1') then return end - Log(GetName(src) ..' Made A Vial Of Heroin', 'heroin') elseif cuth2 then if not GetRecipe(src, 'heroin', 'fillvial', 'tier2') then return end - Log(GetName(src) ..' Made A Vial Of Heroin Tier 2', 'heroin') elseif cuth3 then if not GetRecipe(src, 'heroin', 'fillvial', 'tier3') then return end - Log(GetName(src) ..' Made A Vial Of Heroin Tier 3', 'heroin') else Notifys(src, 'no cut heroin', "error") end else if not GetRecipe(src, 'heroin', 'fillvial', 'tier1') then return end - Log(GetName(src) ..' Made A Vial Of Heroin', 'heroin') end end) @@ -172,7 +157,6 @@ local Player = getPlayer(src) local cuth = Player.Functions.GetItemByName('heroincut') local cuth2 = Player.Functions.GetItemByName('heroincutstagetwo') local cuth3 = Player.Functions.GetItemByName('heroincutstagethree') -Log(GetName(src) ..' Sucks And Burned Their Heroin', 'heroin') if cuth then RemoveItem(src, 'heroincut', 1) Notifys(src,Lang.Heroin.fail, "error") @@ -199,21 +183,17 @@ RegisterServerEvent('md-drugs:server:fillneedle', function(num) if vh then if not GetRecipe(src, 'heroin', 'fillneedle', 'tier1') then return end AddRep(src, 'heroin') - Log(GetName(src) ..' Filled A Needle Of Heroin And Now Has A Rep Of ' .. heroin + 1 .. '!' , 'heroin') elseif vh2 then if not GetRecipe(src, 'heroin', 'fillneedle', 'tier2') then return end AddRep(src, 'heroin') - Log(GetName(src) ..' Filled A Needle Of Heroin Tier 2 And Now Has A Rep Of ' .. heroin + 1 .. '!' , 'heroin') elseif vh3 then if not GetRecipe(src, 'heroin', 'fillneedle', 'tier3') then return end AddRep(src, 'heroin') - Log(GetName(src) ..' Filled A Needle Of Heroin Tier 3 And Now Has A Rep Of ' .. heroin + 1 .. '!' , 'heroin') else Notifys(src,Lang.Heroin.nofill, "error") end else if not GetRecipe(src, 'heroin', 'fillneedle', 'tier1') then return end - Log(GetName(src) ..' Filled A Needle Of Heroin!' , 'heroin') end end) diff --git a/server/locations.lua b/server/locations.lua index 89adb4e..2922ee9 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -123,8 +123,10 @@ function checkLoc(source, event, num) end local dist = #(coord - loc) if dist < 2.5 then + Log(GetName(source) .. ' Triggered the table ' .. event .. ' Within The Correct Distance', 'locations') return true else + Log(GetName(source) .. ' Triggered the table ' .. event .. ' Not Within The Correct Distance', 'locations') Notifys(source, 'You are not in the correct location', 'error') return false end diff --git a/server/lsd.lua b/server/lsd.lua index a2d1b72..48c1171 100644 --- a/server/lsd.lua +++ b/server/lsd.lua @@ -7,7 +7,6 @@ RegisterServerEvent('md-drugs:server:getlysergic', function(num) local src = source if not checkLoc(src, 'lysergicacid', num) then return end if AddItem(src,'lysergic_acid', 2) then - Log(GetName(src) ..' Got Lysergic acid!', 'lsd') end end) @@ -15,7 +14,6 @@ RegisterServerEvent('md-drugs:server:getdiethylamide', function(num) local src = source if not checkLoc(src, 'diethylamide', num) then return end if AddItem(src,'diethylamide', 2) then - Log(GetName(src) ..' Got diethylamide!', 'lsd') end end) @@ -24,7 +22,6 @@ QBCore.Functions.CreateUseableItem('lsdlabkit', function(source, item) local src = source if TriggerClientEvent("md-drugs:client:setlsdlabkit", src) then RemoveItem(src, "lsdlabkit", 1) - Log(GetName(src) ..' Placed Their LSD Lab Kit Back At ' .. GetCoords(src) .. '!', 'lsd') end end) @@ -33,7 +30,6 @@ lib.callback.register('md-drugs:server:removecleaningkit', function(source) local src = source if not Itemcheck(src, 'cleaningkit', 1) then return end if RemoveItem(src,"cleaningkit", 1) then - Log(GetName(src) ..' Wiped Down Their LSD Lab Kit!' , 'lsd') return true end end) @@ -48,12 +44,12 @@ end) RegisterServerEvent('md-drugs:server:heatliquid', function() local src = source if not GetRecipe(src, 'lsd', 'vial', 'heat') then return end - Log(GetName(src) ..' Heated Basic LSD!', 'lsd') end) RegisterServerEvent('md-drugs:server:failheating', function() local src = source - if not ChecknRemove(source, {lysergic_acid = 1, diethylamide = 1}) then return end + RemoveItem(src, 'lysergic_acid', 1) + RemoveItem(src, 'diethylamide', 1) Notifys(src,Lang.lsd.failed, "error") Log(GetName(src) ..' Failed Basic LSD Like An Idiot!', 'lsd') end) @@ -111,7 +107,6 @@ RegisterServerEvent('md-drugs:server:gettabpaper', function(num) if not checkLoc(src, 'gettabs', num) then return end if Player.Functions.RemoveMoney('cash', prices.tabcost * 10) then AddItem(src,'tab_paper', 10) - Log(GetName(src) ..' Bought Tab Paper!', 'lsd') else Notifys(Lang.lsd.broke, "error") end @@ -123,7 +118,6 @@ RegisterServerEvent('md-drugs:server:getlabkit', function() if not checkLoc(src,'singleSpot', 'buylsdlabkit') then return end if Player.Functions.RemoveMoney('cash', prices.lsdlabkitcost) then AddItem(src,'lsdlabkit', 1) - Log(GetName(src) ..' Bought A LSD Lab Kit!', 'lsd') else Notifys(src, Lang.lsd.broke, "error") end diff --git a/server/mescaline.lua b/server/mescaline.lua index 2e88492..07905f4 100644 --- a/server/mescaline.lua +++ b/server/mescaline.lua @@ -45,7 +45,6 @@ RegisterNetEvent("Mescaline:pickupCane", function(loc) TriggerClientEvent("Mescaline:removeCane", -1, loc) MescalineCooldown(loc) AddItem(source,'cactusbulb', 1) - Log(GetName(source) .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, m[loc].location) .. ' vectors', 'mescaline') end end) @@ -53,7 +52,6 @@ RegisterNetEvent("md-drugs:server:drymescaline", function() local src = source if not checkLoc(src, 'singleSpot', 'DryOut') then return end if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end - Log(GetName(source) .. ' Dried Mescaline', 'mescaline') end) QBCore.Functions.CreateUseableItem("driedmescaline", function(source, item) diff --git a/server/recipes.lua b/server/recipes.lua index 361ba0b..867b6ac 100644 --- a/server/recipes.lua +++ b/server/recipes.lua @@ -155,8 +155,9 @@ function GetRecipe(source, type, method, tier) 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 diff --git a/server/xtc.lua b/server/xtc.lua index 2d5a38d..abfb597 100644 --- a/server/xtc.lua +++ b/server/xtc.lua @@ -1,12 +1,12 @@ local QBCore = exports['qb-core']:GetCoreObject() -------------------- stealing ingridients +local activePresses = {} RegisterServerEvent('md-drugs:server:stealisosafrole', function(num) local src = source local Player = getPlayer(src) if not checkLoc(src, 'isosafrole',num) then return end if AddItem(src, "isosafrole", 1) then - Log(GetName(source) .. ' Stole isosafrole with a distance of ' .. dist(source, Config.isosafrole[num]['loc']) .. ' vectors!', 'xtc') - end + end end) RegisterServerEvent('md-drugs:server:stealmdp2p', function(num) @@ -14,7 +14,6 @@ RegisterServerEvent('md-drugs:server:stealmdp2p', function(num) local Player = getPlayer(src) if not checkLoc(src, 'mdp2p',num) then return end if AddItem(src,"mdp2p", 1) then - Log(GetName(source) .. ' Stole MDP2P with a distance of ' .. dist(source, Config.mdp2p[num]['loc']) .. ' vectors!', 'xtc') end end) @@ -28,9 +27,18 @@ for k, v in pairs (presses) do QBCore.Functions.CreateUseableItem(v.item, function(source, item) local src = source local Player = getPlayer(src) - if TriggerClientEvent("md-drugs:client:setpress", src, v.data) then - RemoveItem(src, v.item, 1) - Log(GetName(source) .. ' Placed A ' .. v.item .. ' At ' .. GetCoords(source) .. '!', 'xtc') +local check, loc = lib.callback.await('md-drugs:client:setpress', src, v.data) + if check then + if RemoveItem(src, v.item, 1) then + table.insert(activePresses, { + press = v.data, + get = v.item, + owner = GetName(src), + ownerid = Player.PlayerData.citizenid, + src = src, + loc = loc + }) + end end end) end @@ -38,85 +46,75 @@ end RegisterServerEvent('md-drugs:server:getpressback', function(type) local src = source local Player = getPlayer(src) - if type == 'single' then - if Player.Functions.GetItemByName('singlepress') then Notifys(src, 'You Already Have A Kit') return end - AddItem(src, 'singlepress', 1) - Log(GetName(source) .. ' Picked Their Single Press At ' .. GetCoords(source) .. '!', 'xtc') - elseif type == 'dual' then - if Player.Functions.GetItemByName('dualpress') then Notifys(src, 'You Already Have A Kit') return end - AddItem(src, 'dualpress', 1) - Log(GetName(source) .. ' Picked Their Dual Press At ' .. GetCoords(source) .. '!', 'xtc') - elseif type == 'triple' then - if Player.Functions.GetItemByName('triplepress') then Notifys(src, 'You Already Have A Kit') return end - AddItem(src, 'triplepress', 1) - Log(GetName(source) .. ' Picked Their Triple Press At ' .. GetCoords(source) .. '!', 'xtc') - elseif type == 'quad' then - if Player.Functions.GetItemByName('quadpress') then Notifys(src, 'You Already Have A Kit') return end - AddItem(src, 'quadpress', 1) - Log(GetName(source) .. ' Picked Their Quad Press At ' .. GetCoords(source) .. '!', 'xtc') - end + for k, v in pairs (activePresses) do + if v.ownerid == Player.PlayerData.citizenid then + if v.press == type then + table.remove(activePresses, k) + AddItem(src, v.get, 1) + end + end + end end) +local function pressout(source) + local src = source + local Player = getPlayer(src) + local ped = GetPlayerPed(src) + local coords = GetEntityCoords(ped) + for k, v in pairs (activePresses) do + if v.ownerid == Player.PlayerData.citizenid then + if #(coords - v.loc) < 3.0 then + return v.press + end + end + end + return 'none' +end RegisterServerEvent('md-drugs:server:makextc', function(data) local src = source local Player = getPlayer(src) if not Itemcheck(src, 'raw_xtc', 1) then return end - if data.data == 'single' then + if pressout(src) == 'none' then return end + if pressout(src) == 'single' then if data.color == 'white' then if not GetRecipe(src, 'xtc', 'singlestack', 'white') then return end - Log(GetName(source) .. ' Made A Single Stack White Pill!', 'xtc') elseif data.color == 'red' then if not GetRecipe(src, 'xtc', 'singlestack', 'red') then return end - Log(GetName(source) .. ' Made A Single Stack Red Pill!', 'xtc') elseif data.color == 'orange' then if not GetRecipe(src, 'xtc', 'singlestack', 'orange') then return end - Log(GetName(source) .. ' Made A Single Stack Orange Pill!', 'xtc') elseif data.color == 'blue' then if not GetRecipe(src, 'xtc', 'singlestack', 'blue') then return end - Log(GetName(source) .. ' Made A Single Stack Blue Pill!', 'xtc') end - elseif data.data == 'dual' then + elseif pressout(src) == 'dual' then if data.color == 'white' then if not GetRecipe(src, 'xtc', 'dualstack', 'white') then return end - Log(GetName(source) .. ' Made A Dual Stack White Pill!', 'xtc') elseif data.color == 'red' then if not GetRecipe(src, 'xtc', 'dualstack', 'red') then return end - Log(GetName(source) .. ' Made A Dual Stack Red Pill!', 'xtc') elseif data.color == 'orange' then if not GetRecipe(src, 'xtc', 'dualstack', 'orange') then return end - Log(GetName(source) .. ' Made A Dual Stack Orange Pill!', 'xtc') elseif data.color == 'blue' then if not GetRecipe(src, 'xtc', 'dualstack', 'blue') then return end - Log(GetName(source) .. ' Made A Dual Stack Blue Pill!', 'xtc') end - elseif data.data == 'triple' then + elseif pressout(src) == 'triple' then if data.color == 'white' then if not GetRecipe(src, 'xtc', 'triplestack', 'white') then return end - Log(GetName(source) .. ' Made A Triple Stack White Pill!', 'xtc') elseif data.color == 'red' then if not GetRecipe(src, 'xtc', 'triplestack', 'red') then return end - Log(GetName(source) .. ' Made A Triple Stack Red Pill!', 'xtc') elseif data.color == 'orange' then if not GetRecipe(src, 'xtc', 'triplestack', 'orange') then return end - Log(GetName(source) .. ' Made A Triple Stack Orange Pill!', 'xtc') elseif data.color == 'blue' then if not GetRecipe(src, 'xtc', 'triplestack', 'blue') then return end - Log(GetName(source) .. ' Made A Triple Stack Blue Pill!', 'xtc') end - elseif data.data == 'quad' then + elseif pressout(src) == 'quad' then if data.color == 'white' then if not GetRecipe(src, 'xtc', 'quadstack', 'white') then return end - Log(GetName(source) .. ' Made A Quad Stack White Pill!', 'xtc') elseif data.color == 'red' then if not GetRecipe(src, 'xtc', 'quadstack', 'red') then return end - Log(GetName(source) .. ' Made A Quad Stack Red Pill!', 'xtc') elseif data.color == 'orange' then if not GetRecipe(src, 'xtc', 'quadstack', 'orange') then return end - Log(GetName(source) .. ' Made A Quad Stack Orange Pill!', 'xtc') elseif data.color == 'blue' then if not GetRecipe(src, 'xtc', 'quadstack', 'blue') then return end - Log(GetName(source) .. ' Made A Quad Stack Blue Pill!', 'xtc') end end end) @@ -135,17 +133,12 @@ RegisterServerEvent('md-drugs:server:buypress', function() RegisterServerEvent('md-drugs:server:upgradepress', function(data) local src = source - - if CheckDist(source, Config.buypress) then return end if data == 'dual' then if not GetRecipe(src, 'xtc', 'press', 'dual') then return end - Log(GetName(source) .. ' Upgraded Press To Dual Press', 'xtc') elseif data == 'triple' then if not GetRecipe(src, 'xtc', 'press', 'triple') then return end - Log(GetName(source) .. ' Upgraded Press To Triple Press', 'xtc') elseif data == 'quad' then if not GetRecipe(src, 'xtc', 'press', 'quad') then return end - Log(GetName(source) .. ' Upgraded Press To Quad Press', 'xtc') else Notifys(src, 'huh', 'error') end @@ -157,34 +150,25 @@ RegisterServerEvent('md-drugs:server:makingrawxtc', function(num) local Player = getPlayer(src) if not checkLoc(src, 'rawxtcloc',num) then return end if not GetRecipe(src, 'xtc', 'raw', 'raw_xtc') then return end - Log(GetName(source) .. ' Made Raw XTC With A Distance Of ' .. dist(source, Config.rawxtcloc[num]['loc']) .. '!', 'xtc') end) RegisterServerEvent('md-drugs:server:stampwhite', function(num) local src = source - local Player = getPlayer(src) local one = {'white_playboys', 'white_aliens', 'white_pl', 'white_trolls', 'white_cats'} local chance = math.random(#one) local two = {'white_playboys2', 'white_aliens2', 'white_pl2', 'white_trolls2', 'white_cats2'} - local chance2 = math.random(#one) local three = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'} - local chance3 = math.random(#one) local four = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'} - local chance4 = math.random(#one) if not checkLoc(src, 'stamp', num) then return end if RemoveItem(src, "white_xtc", 1) then AddItem(src, one[chance], 1) - Log(GetName(source) .. ' Stamped A Single White Pill And Got ' .. one[chance] .. '!', 'xtc') elseif RemoveItem(src, "white_xtc2", 1) then - AddItem(src, two[chance2], 1) - Log(GetName(source) .. ' Stamped A Dual White Pill And Got ' .. two[chance2] .. '!', 'xtc') + AddItem(src, two[chance], 1) elseif RemoveItem(src, "white_xtc3", 1) then - AddItem(src, three[chance3], 1) - Log(GetName(source) .. ' Stamped A Triple White Pill And Got ' .. three[chance3] .. '!', 'xtc') + AddItem(src, three[chance], 1) elseif RemoveItem(src, "white_xtc4", 1) then - AddItem(src, four[chance4], 1) - Log(GetName(source) .. ' Stamped A Quad White Pill And Got ' .. four[chance4] .. '!', 'xtc') + AddItem(src, four[chance], 1) else Notifys('You Dont Have Unstamped White Pills', 'error') end @@ -192,30 +176,21 @@ end) RegisterServerEvent('md-drugs:server:stampred', function(num) local src = source - local Player = getPlayer(src) local one = {'red_playboys', 'red_aliens', 'red_pl', 'red_trolls', 'red_cats'} local chance = math.random(#one) local two = {'red_playboys2', 'red_aliens2', 'red_pl2', 'red_trolls2', 'red_cats2'} - local chance2 = math.random(#one) local three = {'red_playboys3', 'red_aliens3', 'red_pl3', 'red_trolls3', 'red_cats3'} - local chance3 = math.random(#one) local four = {'red_playboys4', 'red_aliens4', 'red_pl4', 'red_trolls4', 'red_cats4'} - local chance4 = math.random(#one) - local playerPed = GetPlayerPed(source) if not checkLoc(src, 'stamp', num) then return end if RemoveItem(src, "red_xtc", 1) then AddItem(src, one[chance], 1) - Log(GetName(source) .. ' Stamped A Single Red Pill And Got ' .. one[chance] .. '!', 'xtc') elseif RemoveItem(src, "red_xtc2", 1) then - AddItem(src, two[chance2], 1) - Log(GetName(source) .. ' Stamped A Dual Red Pill And Got ' .. two[chance2] .. '!', 'xtc') + AddItem(src, two[chance], 1) elseif RemoveItem(src, "red_xtc3", 1) then - AddItem(src, three[chance3], 1) - Log(GetName(source) .. ' Stamped A Triple Red Pill And Got ' .. three[chance3] .. '!', 'xtc') + AddItem(src, three[chance], 1) elseif RemoveItem(src, "red_xtc4", 1) then - AddItem(src, four[chance4], 1) - Log(GetName(source) .. ' Stamped A Quad Red Pill And Got ' .. four[chance4] .. '!', 'xtc') + AddItem(src, four[chance], 1) else Notifys('You Dont Have Unstamped red Pills', 'error') end @@ -223,30 +198,21 @@ end) RegisterServerEvent('md-drugs:server:stamporange', function(num) local src = source - local Player = getPlayer(src) local one = {'orange_playboys', 'orange_aliens', 'orange_pl', 'orange_trolls', 'orange_cats'} - local chance = math.random(#one) local two = {'orange_playboys2', 'orange_aliens2', 'orange_pl2', 'orange_trolls2', 'orange_cats2'} - local chance2 = math.random(#one) local three = {'orange_playboys3', 'orange_aliens3', 'orange_pl3', 'orange_trolls3', 'orange_cats3'} - local chance3 = math.random(#one) local four = {'orange_playboys4', 'orange_aliens4', 'orange_pl4', 'orange_trolls4', 'orange_cats4'} - local chance4 = math.random(#one) - local playerPed = GetPlayerPed(source) + local chance = math.random(#one) if not checkLoc(src, 'stamp', num) then return end if RemoveItem(src, "orange_xtc", 1) then AddItem(src, one[chance], 1) - Log(GetName(source) .. ' Stamped A Single Orange Pill And Got ' .. one[chance] .. '!', 'xtc') elseif RemoveItem(src, "orange_xtc2", 1) then - AddItem(src, two[chance2], 1) - Log(GetName(source) .. ' Stamped A Dual Orange Pill And Got ' .. two[chance2] .. '!', 'xtc') + AddItem(src, two[chance], 1) elseif RemoveItem(src, "orange_xtc3", 1) then - AddItem(src, three[chance3], 1) - Log(GetName(source) .. ' Stamped A Triple Orange Pill And Got ' .. three[chance3] .. '!', 'xtc') + AddItem(src, three[chance], 1) elseif RemoveItem(src, "orange_xtc4", 1) then - AddItem(src, four[chance4], 1) - Log(GetName(source) .. ' Stamped A Quad Orange Pill And Got ' .. four[chance4] .. '!', 'xtc') + AddItem(src, four[chance], 1) else Notifys('You Dont Have Unstamped orange Pills', 'error') end @@ -254,28 +220,20 @@ end) RegisterServerEvent('md-drugs:server:stampblue', function(num) local src = source - local Player = getPlayer(src) local one = {'blue_playboys', 'blue_aliens', 'blue_pl', 'blue_trolls', 'blue_cats'} local chance = math.random(#one) local two = {'blue_playboys2', 'blue_aliens2', 'blue_pl2', 'blue_trolls2', 'blue_cats2'} - local chance2 = math.random(#one) local three = {'blue_playboys3', 'blue_aliens3', 'blue_pl3', 'blue_trolls3', 'blue_cats3'} - local chance3 = math.random(#one) local four = {'blue_playboys4', 'blue_aliens4', 'blue_pl4', 'blue_trolls4', 'blue_cats4'} - local chance4 = math.random(#one) - local playerPed = GetPlayerPed(source) if not checkLoc(src, 'stamp', num) then return end if RemoveItem(src, "blue_xtc", 1) then AddItem(src, one[chance], 1) elseif RemoveItem(src, "blue_xtc2", 1) then - AddItem(src, two[chance2], 1) - Log(GetName(source) .. ' Stamped A Dual Blue Pill And Got ' .. two[chance2] .. '!', 'xtc') + AddItem(src, two[chance], 1) elseif RemoveItem(src, "blue_xtc3", 1) then - AddItem(src, three[chance3], 1) - Log(GetName(source) .. ' Stamped A Triple Blue Pill And Got ' .. three[chance3] .. '!', 'xtc') + AddItem(src, three[chance], 1) elseif RemoveItem(src, "blue_xtc4", 1) then - AddItem(src, four[chance4], 1) - Log(GetName(source) .. ' Stamped A Quad Blue Pill And Got ' .. four[chance4] .. '!', 'xtc') + AddItem(src, four[chance], 1) else Notifys('You Dont Have Unstamped blue Pills', 'error') end From cdd26ab465e6c91fc5dfa4a75f69f3f3062602d1 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:26:27 -0800 Subject: [PATCH 13/36] bug fixes labkit/presses now are tabled in server side and has checks to see if you have an active table before proceeding/ gives back item if headpop or crash --- client/heroin.lua | 8 +++--- client/lsd.lua | 46 +++++++++++++++++---------------- client/meth.lua | 19 -------------- client/oxyruns.lua | 3 ++- client/pedspawns.lua | 3 +++ server/heroin.lua | 61 ++++++++++++++++++++++++++++++++++++-------- server/locations.lua | 2 +- server/lsd.lua | 57 ++++++++++++++++++++++++++++++++++++----- server/xtc.lua | 12 +++++++++ shared/config.lua | 2 +- 10 files changed, 149 insertions(+), 64 deletions(-) diff --git a/client/heroin.lua b/client/heroin.lua index 198183f..d474188 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -71,15 +71,17 @@ RegisterNetEvent("md-drugs:client:buyheroinlabkit", function() TriggerServerEvent("md-drugs:server:getheroinlabkit") end) -RegisterNetEvent("md-drugs:client:setheroinlabkit", function() +lib.callback.register("md-drugs:client:setheroinlabkit", function() if herointable then Notify(Lang.Heroin.tableout, 'error') + return false else herointable = true local location, head = StartRay() - if not location then herointable = false TriggerServerEvent('md-drugs:server:getheroinlabkitback') return end - if not progressbar(Lang.Heroin.table, 4000, 'uncuff') then TriggerServerEvent('md-drugs:server:getheroinlabkitback') return end + if not location then herointable = false return end + if not progressbar(Lang.Heroin.table, 4000, 'uncuff') then return end createLabKit(location, head) + return true, location end end) diff --git a/client/lsd.lua b/client/lsd.lua index 29a3ffb..03fef3c 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -28,17 +28,19 @@ RegisterNetEvent("md-drugs:client:getdiethylamide", function(data) TriggerServerEvent('md-drugs:server:getdiethylamide', data.data) end) -RegisterNetEvent("md-drugs:client:setlsdlabkit", function() -if tableout then - Notify(Lang.lsd.tableout, 'error') - TriggerServerEvent('md-drugs:server:getlabkitback') -else - tableout = true - local loc, head = StartRay() - if not loc then tableout = false TriggerServerEvent('md-drugs:server:getlabkitback') return end - if not progressbar(Lang.lsd.place, 4000, 'uncuff') then TriggerServerEvent('md-drugs:server:getlabkitback') return end - createLabKit(loc, head) -end + +lib.callback.register("md-drugs:client:setlsdlabkit", function() + if tableout then + Notify(Lang.lsd.tableout, 'error') + return false + else + tableout = true + local loc, head = StartRay() + if not loc then tableout = false return end + if not progressbar(Lang.lsd.place, 4000, 'uncuff') then return end + createLabKit(loc, head) + return true, loc + end end) RegisterNetEvent("md-drugs:client:getlabkitback", function(data) @@ -63,22 +65,22 @@ RegisterNetEvent("md-drugs:client:heatliquid", function(data) PlaceObjectOnGroundProperly(dirtylabkit) 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 ) + AddSingleModel(dirtylabkit, {icon = "fa-solid fa-hand-sparkles", label = Lang.targets.lsd.clean, data = dirtylabkit, + action = function() + if not ItemCheck('cleaningkit') then return end + if not progressbar(Lang.lsd.clean, 4000, 'clean') then return end + local check = lib.callback.await('md-drugs:server:removecleaningkit') + if check then + DeleteObject(dirtylabkit) + createLabKit(PedCoords, head) + end + end + }, nil ) return end if not progressbar(Lang.lsd.heat, 7000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:heatliquid") end) -RegisterNetEvent("md-drugs:client:cleanlabkit", function(data) - if not ItemCheck('cleaningkit') then return end - if not progressbar(Lang.lsd.clean, 4000, 'clean') then return end - local check = lib.callback.await('md-drugs:server:removecleaningkit') - if check then - local coord, head = GetEntityCoords(data.data), GetEntityHeading(data.data) - DeleteObject(data.data) - createLabKit(coord, head) - end -end) RegisterNetEvent("md-drugs:client:refinequalityacid", function() if not ItemCheck('lsd_one_vial') then return end diff --git a/client/meth.lua b/client/meth.lua index a18bb0c..fb27273 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -115,25 +115,6 @@ CreateThread(function() end end) -CreateThread(function() -if not Config.MethHeist == false then - local current = "g_m_y_famdnf_01" - lib.requestModel(current, Config.RequestModelTime) - local CurrentLocation = Config.MethHeistStart - local methdealer = CreatePed(0, current, CurrentLocation.x, CurrentLocation.y, CurrentLocation.z - 1, false, false) - Freeze(methdealer, true, 220.0) - Wait(100) - AddSingleModel(methdealer,{ - label = Lang.targets.meth.mission, - icon = "fas fa-eye", - action = function() - Notify(Lang.meth.mission, "success") - SpawnMethCarPedChase() - end, - },nil ) -end -end) - RegisterNetEvent("md-drugs:client:stealeph", function(data) if not progressbar('Stealing Ephedrine', 4000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:geteph", data.data) diff --git a/client/oxyruns.lua b/client/oxyruns.lua index 68e23c3..9714781 100644 --- a/client/oxyruns.lua +++ b/client/oxyruns.lua @@ -5,7 +5,8 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function() lib.requestModel("burrito3", Config.RequestModelTime) local paid = lib.callback.await('md-drugs:server:payfortruck', false) if not paid then return end - local oxycar = CreateVehicle("burrito3",Config.truckspawn.x, Config.truckspawn.y,Config.truckspawn.z, Config.truckspawn.w, true, false) + local loc = lib.callback.await('md-drugs:server:getLocs', false) + local oxycar = CreateVehicle("burrito3",loc.singleSpot.truckspawn.x, loc.singleSpot.truckspawn.y,loc.singleSpot.truckspawn.z, loc.singleSpot.truckspawn.w, true, false) exports[Config.Fuel]:SetFuel(oxycar, 100.0) TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(oxycar)) Notify(Lang.oxy.truck, 'success') diff --git a/client/pedspawns.lua b/client/pedspawns.lua index 57a2249..64accf0 100644 --- a/client/pedspawns.lua +++ b/client/pedspawns.lua @@ -12,12 +12,15 @@ CreateThread(function() local heroinkitdealer = CreatePed(0,"g_m_y_famdnf_01",config.singleSpot.buyheroinlabkit.x, config.singleSpot.buyheroinlabkit.y, config.singleSpot.buyheroinlabkit.z-1, config.singleSpot.buyheroinlabkit.w, false, false) local SyrupLocation = CreatePed(0, 's_m_m_doctor_01', config.singleSpot.SyrupVendor.x,config.singleSpot.SyrupVendor.y,config.singleSpot.SyrupVendor.z-1, config.singleSpot.SyrupVendor.w, false, false) local WeedGuy = CreatePed(0,'u_m_m_jesus_01',config.singleSpot.WeedSaleman.x,config.singleSpot.WeedSaleman.y,config.singleSpot.WeedSaleman.z-1, config.singleSpot.WeedSaleman.w, false, false) + local methdealer = CreatePed(0, "g_m_y_famdnf_01", config.singleSpot.MethHeistStart.x, config.singleSpot.MethHeistStart.y, config.singleSpot.MethHeistStart.z - 1, false, false) Freeze(tabdealer, true,config.singleSpot.buylsdlabkit.w) Freeze(SyrupLocation, true, config.singleSpot.SyrupVendor.w) Freeze(heroinkitdealer, true, config.singleSpot.buyheroinlabkit.w) Freeze(WeedGuy, true, config.singleSpot.WeedSaleman.w) + Freeze(methdealer, true, 220.0) AddSingleModel(tabdealer,{ type = "client", label = Lang.targets.lsd.buy, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buylabkit", distance = 2.0}, tabdealer ) AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil ) AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil ) AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fas fa-eye", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil) + AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fas fa-eye", action = function() Notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil ) end) \ No newline at end of file diff --git a/server/heroin.lua b/server/heroin.lua index f899221..79f6c91 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -2,6 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject() local prices = { heroinlabkitprice = 10000 } +local heroinLabKits = {} local h = { { location = vector3(-2251.3, -99.18, 100.11), heading = 334.49, model = "prop_plant_01b"}, { location = vector3(-2249.63, -92.97, 101.8), heading = 329.56, model = "prop_plant_01b"}, @@ -17,6 +18,7 @@ local h = { { location = vector3(-2250.96, -111.22, 97.50), heading = 21.52, model = "prop_plant_01b"}, { location = vector3(465.95, -1021.32, 31.78), heading = 21.52, model = "prop_plant_01b"}, } + GlobalState.PoppyPlants = h Citizen.CreateThread(function() for _, v in pairs(h) do @@ -110,28 +112,55 @@ RegisterServerEvent('md-drugs:server:getheroinlabkit', function() end end) -RegisterServerEvent('md-drugs:server:getheroinlabkitback', function() -local src = source -local Player = getPlayer(src) - if AddItem(src, "heroinlabkit", 1) then +local function hasHKit(src) + local src = source + local Player = getPlayer(src) + for k, v in pairs(heroinLabKits) do + if v.ownerid == Player.PlayerData.citizenid then + return true + end end + return false +end + +RegisterServerEvent('md-drugs:server:getheroinlabkitback', function() + local src = source + local Player = getPlayer(src) + if not hasHKit(src) then return end + for k, v in pairs (heroinLabKits) do + if v.ownerid == Player.PlayerData.citizenid then + table.remove(heroinLabKits, k) + AddItem(src, 'heroinlabkit', 1) + end + end + print(json.encode(heroinLabKits)) end) + QBCore.Functions.CreateUseableItem('heroinlabkit', function(source, item) -local src = source -local Player = getPlayer(src) + local src = source + local Player = getPlayer(src) if not Itemcheck(source, 'heroinlabkit', 1) then return end - if TriggerClientEvent("md-drugs:client:setheroinlabkit", src) then - RemoveItem(src, "heroinlabkit", 1) - Log(GetName(src) ..' Placed Their Heroin Lab Kit Back At ' .. GetCoords(src) .. '!', 'heroin') + local placed, loc = lib.callback.await('md-drugs:client:setheroinlabkit', src) + if placed then + RemoveItem(src, 'heroinlabkit', 1) + table.insert(heroinLabKits, { + src = src, + ownerid = Player.PlayerData.citizenid, + coords = loc, + name = GetName(src) + }) + Notifys(src, Lang.Heroin.placed, "success") end + print(json.encode(heroinLabKits)) end) RegisterServerEvent('md-drugs:server:heatliquidheroin', function() local src = source -local Player = getPlayer(src) +local Player = getPlayer(src) + if not hasHKit(src) then return end if not Itemcheck(source, 'emptyvial', 1) then return end if Config.TierSystem then local cuth = Player.Functions.GetItemByName('heroincut') @@ -154,6 +183,7 @@ end) RegisterServerEvent('md-drugs:server:failheatingheroin', function() local src = source local Player = getPlayer(src) +if not hasHKit(src) then return end local cuth = Player.Functions.GetItemByName('heroincut') local cuth2 = Player.Functions.GetItemByName('heroincutstagetwo') local cuth3 = Player.Functions.GetItemByName('heroincutstagethree') @@ -216,3 +246,14 @@ RegisterServerEvent('md-drugs:server:failheroin', function() end end) +AddEventHandler('playerDropped', function() + local src = source + local Player = getPlayer(src) + for k, v in pairs(heroinLabKits) do + if v.src == src then + table.remove(heroinLabKits, k) + AddItem(src, 'heroinlabkit', 1) + end + end + json.encode(heroinLabKits) +end) \ No newline at end of file diff --git a/server/locations.lua b/server/locations.lua index 2922ee9..bfeeb91 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -69,7 +69,7 @@ local Target = { WeedSaleman = vector4(1030.77, -3203.18, -38.2, 262.37), -- where the weed saleman is MethTeleIn = vector3(-2222.04, 303.99, 174.6), -- where you target to tele in meth MethTeleOut = vector3(996.91, -3200.83, -36.39), -- where you target to tele out meth - MethHeistStart = vector3(-1102.93, -3066.76, 14.00), -- where you get the mission to get ingridients if meth heist = true + MethHeistStart = vector4(-1520.84, 827.72, 181.66, 184.13), -- where you get the mission to get ingridients if meth heist = true truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95), --- where the truck will spawn when you pay for it Payfortruck = vector3(1437.64, -1491.91, 63.62), --- where you pay for the truck }, diff --git a/server/lsd.lua b/server/lsd.lua index 48c1171..ce1675c 100644 --- a/server/lsd.lua +++ b/server/lsd.lua @@ -3,6 +3,8 @@ local prices = { tabcost = 100, -- price per piece of tab paper event does 10 at a time lsdlabkitcost = 10000 -- price of the lsd lab kit } + +local lsdTables = {} RegisterServerEvent('md-drugs:server:getlysergic', function(num) local src = source if not checkLoc(src, 'lysergicacid', num) then return end @@ -19,12 +21,31 @@ end) QBCore.Functions.CreateUseableItem('lsdlabkit', function(source, item) -local src = source - if TriggerClientEvent("md-drugs:client:setlsdlabkit", src) then - RemoveItem(src, "lsdlabkit", 1) + local src = source + local Player = getPlayer(src) + local placed, loc = lib.callback.await('md-drugs:client:setlsdlabkit', src) + if placed then + if RemoveItem(src, 'lsdlabkit', 1) then + table.insert(lsdTables, { + owner = GetName(src), + ownerid = Player.PlayerData.citizenid, + src = src, + loc = loc + }) + end end + print(json.encode(lsdTables)) end) +local function hasLabKit(source) + local src = source + local Player = getPlayer(src) + for k, v in pairs (lsdTables) do + if v.ownerid == Player.PlayerData.citizenid then + return true + end + end +end lib.callback.register('md-drugs:server:removecleaningkit', function(source) local src = source @@ -36,18 +57,25 @@ end) RegisterServerEvent('md-drugs:server:getlabkitback', function() local src = source - if AddItem(src,"lsdlabkit", 1) then - Log(GetName(src) ..' Picked Up Their LSD Lab Kit Back At ' .. GetCoords(src) .. '!', 'lsd') + local Player = getPlayer(src) + for k, v in pairs (lsdTables) do + if v.ownerid == Player.PlayerData.citizenid then + table.remove(lsdTables, k) + AddItem(src, 'lsdlabkit', 1) + end end + print(json.encode(lsdTables)) end) RegisterServerEvent('md-drugs:server:heatliquid', function() local src = source + if not hasLabKit(src) then return end if not GetRecipe(src, 'lsd', 'vial', 'heat') then return end end) RegisterServerEvent('md-drugs:server:failheating', function() local src = source + if not hasLabKit(src) then return end RemoveItem(src, 'lysergic_acid', 1) RemoveItem(src, 'diethylamide', 1) Notifys(src,Lang.lsd.failed, "error") @@ -57,6 +85,7 @@ end) RegisterServerEvent('md-drugs:server:refinequalityacid', function() local src = source +if not hasLabKit(src) then return end if not Itemcheck(src, 'lsd_one_vial', 1) then return end if Config.TierSystem then local lsd = getRep(src, 'lsd') @@ -96,6 +125,7 @@ end) RegisterServerEvent('md-drugs:server:failrefinequality', function() local src = source + if not hasLabKit(src) then return end if not Itemcheck(src, 'lsd_one_vial', 1) then return end RemoveItem(src,'lsd_one_vial', 1) end) @@ -126,6 +156,7 @@ end) RegisterServerEvent('md-drugs:server:maketabpaper', function() local src = source local Player = getPlayer(src) + if not hasLabKit(src) then return end if not Itemcheck(src,'tab_paper', 1) then return end local count = 0 local items, recieve = nil, nil @@ -145,8 +176,8 @@ RegisterServerEvent('md-drugs:server:maketabpaper', function() if check and check.amount >= 1 then items = v.vial recieve = v.sheet - Log(GetName(src) ..' ' .. v.log, 'lsd') count = count + 1 + break end end if count >= 1 then @@ -175,4 +206,16 @@ for k, v in pairs (sheets) do Log(GetName(src) ..' Made ' .. math .. 'Tabs of ' .. v.recieve .. '!', 'lsd') end end) -end \ No newline at end of file +end + +AddEventHandler('playerDropped', function() + local src = source + local Player = getPlayer(src) + for k, v in pairs (lsdTables) do + if v.ownerid == Player.PlayerData.citizenid then + table.remove(lsdTables, k) + AddItem(src, 'lsdlabkit', 1) + end + end + print(json.encode(lsdTables)) +end) \ No newline at end of file diff --git a/server/xtc.lua b/server/xtc.lua index abfb597..43af67d 100644 --- a/server/xtc.lua +++ b/server/xtc.lua @@ -40,6 +40,7 @@ local check, loc = lib.callback.await('md-drugs:client:setpress', src, v.data) }) end end + print(json.encode(activePresses)) end) end @@ -237,4 +238,15 @@ RegisterServerEvent('md-drugs:server:stampblue', function(num) else Notifys('You Dont Have Unstamped blue Pills', 'error') end +end) + +AddEventHandler('playerDropped', function() + local src = source + local Player = getPlayer(src) + for k, v in pairs (activePresses) do + if v.ownerid == Player.PlayerData.citizenid then + table.remove(activePresses, k) + AddItem(src, v.get, 1) + end + end end) \ No newline at end of file diff --git a/shared/config.lua b/shared/config.lua index 143acfc..fa577bc 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -2,7 +2,7 @@ Config = {} --Ignore. Config.Target = 'ox' -- qb or ox Config.respawnTime = 600 -- Seconds -Config.Fuel = "ps-fuel" -- 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.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total Config.RequestModelTime = 30000 -- if you need more time than this, uhhhh wow From 5c5f45420722629241e5669872d550b63bbfeaa0 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 23 Nov 2024 01:58:57 -0800 Subject: [PATCH 14/36] removed 90% of logs ( added logs to getrecipe, locationcheck, and fixed wholesale, dealers, and oxyruns, and meth --- client/cocaine.lua | 1 - client/cornerselling.lua | 1 + client/deliveries.lua | 16 +++- client/functions.lua | 28 +++--- client/meth.lua | 2 +- client/pedspawns.lua | 3 - client/wholesale.lua | 38 +++----- server/cornerselling.lua | 9 -- server/heroin.lua | 2 - server/locations.lua | 7 +- server/lsd.lua | 3 - server/meth.lua | 4 - server/wholesale.lua | 194 ++++++++++----------------------------- server/xtc.lua | 1 - 14 files changed, 97 insertions(+), 212 deletions(-) diff --git a/client/cocaine.lua b/client/cocaine.lua index ed12605..f61e0e6 100644 --- a/client/cocaine.lua +++ b/client/cocaine.lua @@ -79,7 +79,6 @@ end) CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) - if not config then print('why') return end if Config.FancyCokeAnims == false then AddBoxZoneMulti('cuttcoke', config.CuttingCoke, { type = "client",event = "md-drugs:client:cutcokeone", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.coke.cut}) AddBoxZoneMulti('baggcoke', config.BaggingCoke, { type = "client",event = "md-drugs:client:bagcoke", icon = "fa-solid fa-sack-xmark", label = Lang.targets.coke.bag}) diff --git a/client/cornerselling.lua b/client/cornerselling.lua index 003430d..9235d75 100644 --- a/client/cornerselling.lua +++ b/client/cornerselling.lua @@ -4,6 +4,7 @@ local sold = false local targbusy = false local inZone = false local active = false + local function reset(targ) FreezeEntityPosition(targ, false) ClearPedTasks(targ) diff --git a/client/deliveries.lua b/client/deliveries.lua index d626a46..99d95f2 100644 --- a/client/deliveries.lua +++ b/client/deliveries.lua @@ -1,14 +1,13 @@ local QBCore = exports['qb-core']:GetCoreObject() local isActive = false - +local dealer = {} RegisterNetEvent('md-drugs:client:opendealermenu', function() local rep = GetRep() makeMenu('dealermenu', rep) lib.showContext('dealermenu') end) -CreateThread(function() - local dealer = {} +local function SpawnDealer() local getDealers = lib.callback.await('md-drugs:server:getDealers', false) for k,v in pairs(getDealers) do local Ped = "g_m_y_famdnf_01" @@ -30,6 +29,14 @@ CreateThread(function() action = function() TriggerEvent('md-drugs:client:opendealermenu') end, }}, dealer[k]) end +end + +RegisterNetEvent('md-drugs:client:RefreshDealers', function() + SpawnDealer() +end) + +CreateThread(function() + SpawnDealer() end) RegisterNetEvent('md-drugs:client:setLocation', function(data) @@ -54,4 +61,5 @@ RegisterNetEvent('md-drugs:client:setLocation', function(data) end end }, nil) -end) \ No newline at end of file +end) + diff --git a/client/functions.lua b/client/functions.lua index 42f6cb4..55e380c 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -473,15 +473,22 @@ function AddBoxZoneMulti(name, table, data) end function AddBoxZoneMultiOptions(name, loc, data) - 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 = data, distance = 2.5}) - elseif Config.Target == 'ox' then - exports.ox_target:addBoxZone({coords = loc, size = vec3(1,1,1), options = data }) - elseif Config.Target == 'interact' then - exports.interact:AddInteraction({coords = vector3(loc.x, loc.y, loc.z),distance = 2.5,interactDst = 2,id = name,options = data}) - end + local options = {} + for k, v in pairs (data) do + table.insert(options, { + icon = v.icon, 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) @@ -497,13 +504,12 @@ function AddSingleModel(model, data, num) end function AddMultiModel(model, data, num) - local options = {} for k, v in pairs (data) do - options[#options + 1] = { + table.insert(options, { icon = v.icon, 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}) diff --git a/client/meth.lua b/client/meth.lua index fb27273..e6eae09 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -86,7 +86,7 @@ CreateThread(function() 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} ) local options = { - { name = 'methcook', icon = "fa-solid fa-temperature-high", label = Lang.targets.meth.cook, distance = 2.5, action = function() startcook() end, + { name = 'methcook', icon = "fa-solid fa-temperature-high", label = Lang.targets.meth.cook, distance = 2.5, action = function() startcook() end, canInteract = function() if amonia == nil and active == nil then return true diff --git a/client/pedspawns.lua b/client/pedspawns.lua index 64accf0..b167c9b 100644 --- a/client/pedspawns.lua +++ b/client/pedspawns.lua @@ -1,7 +1,4 @@ local QBCore = exports['qb-core']:GetCoreObject() - - - CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01'} diff --git a/client/wholesale.lua b/client/wholesale.lua index 5a6bc2c..e338a79 100644 --- a/client/wholesale.lua +++ b/client/wholesale.lua @@ -2,38 +2,35 @@ local QBCore = exports['qb-core']:GetCoreObject() local miss = false -RegisterNetEvent("md-drugs:client:GetLocation", function(drug, notify) +RegisterNetEvent("md-drugs:client:GetLocation", function(drug) if not GetCops(Config.PoliceCount) then return end if miss then Notify(Lang.Wholesale.al, 'error') else - TriggerServerEvent('md-drugs:server:RemoveBurner', drug) - Notify(notify, 'success') - local CurrentLocation = Config.oxylocations[math.random(#Config.oxylocations)] + local CurrentLocation = drug.location local timer = 0 miss = true SetNewWaypoint(CurrentLocation.x, CurrentLocation.y) lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime) - local current = "g_m_y_famdnf_01" + local current = "g_m_y_famdnf_01" local drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false) FreezeEntityPosition(drugdealer, true) SetEntityInvincible(drugdealer, true) - AddSingleModel(drugdealer, { - type = "client", - label = Lang.Wholesale.talk, + AddMultiModel(drugdealer, {{ + label = Lang.targets.Wholesale.talk, icon = "fas fa-eye", action = function() local luck = math.random(1,100) - if luck >= Config.SuccessfulChance then + if luck <= Config.SuccessfulChance then TriggerEvent("md-drugs:client:SuccessSale", drug) else - TriggerEvent("md-drugs:client:SetUp") + TriggerEvent("md-drugs:client:SetUp", drug) end Wait(3000) DeleteEntity(drugdealer) miss = false - end, - },nil ) + end + }},drugdealer ) repeat Wait(1000) timer = timer + 1 @@ -51,20 +48,11 @@ end) RegisterNetEvent("md-drugs:client:SuccessSale", function(drug) if not progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end - if drug == 'coke' then - TriggerServerEvent("md-drugs:server:wholesalecoke") - elseif drug == 'crack' then - TriggerServerEvent("md-drugs:server:wholesalecrack") - elseif drug == 'lsd' then - TriggerServerEvent("md-drugs:server:wholesalelsd") - elseif drug == 'heroin' then - TriggerServerEvent("md-drugs:server:wholesaleheroin") - elseif drug == 'xtc' then - TriggerEvent("md-drugs:client:wholesalextc") - end + TriggerServerEvent("md-drugs:server:SuccessSale", drug) end) -RegisterNetEvent("md-drugs:client:SetUp", function() - progressbar("YOU FUCKED NOW", 4000, 'uncuff') +RegisterNetEvent("md-drugs:client:SetUp", function(drug) + progressbar("YOU FUCKED NOW", 4000, 'uncuff') + TriggerServerEvent("md-drugs:server:SetUp", drug) SetUpPeds() end) diff --git a/server/cornerselling.lua b/server/cornerselling.lua index 01391e2..33424ab 100644 --- a/server/cornerselling.lua +++ b/server/cornerselling.lua @@ -212,13 +212,4 @@ RegisterServerEvent('md-drugs:server:cornerselling:stop', function() table.remove(DrugDeals, k) end end -end) - -CreateThread(function() -while true do - for k, v in pairs (DrugDeals) do - print('DrugDeals: ', json.encode(v)) - end - Wait(1000) -end end) \ No newline at end of file diff --git a/server/heroin.lua b/server/heroin.lua index 79f6c91..af512b5 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -133,7 +133,6 @@ RegisterServerEvent('md-drugs:server:getheroinlabkitback', function() AddItem(src, 'heroinlabkit', 1) end end - print(json.encode(heroinLabKits)) end) @@ -152,7 +151,6 @@ QBCore.Functions.CreateUseableItem('heroinlabkit', function(source, item) }) Notifys(src, Lang.Heroin.placed, "success") end - print(json.encode(heroinLabKits)) end) diff --git a/server/locations.lua b/server/locations.lua index bfeeb91..ae74aa5 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -137,4 +137,9 @@ lib.callback.register('md-drugs:server:getLocs', function() end) lib.callback.register('md-drugs:server:GetMerchant', function(source) return loc -end) \ No newline at end of file +end) + +function getRandW(src) + local rand = math.random(1, #Target.oxylocations) + return Target.oxylocations[rand] +end \ No newline at end of file diff --git a/server/lsd.lua b/server/lsd.lua index ce1675c..bdae097 100644 --- a/server/lsd.lua +++ b/server/lsd.lua @@ -34,7 +34,6 @@ QBCore.Functions.CreateUseableItem('lsdlabkit', function(source, item) }) end end - print(json.encode(lsdTables)) end) local function hasLabKit(source) @@ -64,7 +63,6 @@ RegisterServerEvent('md-drugs:server:getlabkitback', function() AddItem(src, 'lsdlabkit', 1) end end - print(json.encode(lsdTables)) end) RegisterServerEvent('md-drugs:server:heatliquid', function() @@ -217,5 +215,4 @@ AddEventHandler('playerDropped', function() AddItem(src, 'lsdlabkit', 1) end end - print(json.encode(lsdTables)) end) \ No newline at end of file diff --git a/server/meth.lua b/server/meth.lua index cbd0ba0..b432da9 100644 --- a/server/meth.lua +++ b/server/meth.lua @@ -4,7 +4,6 @@ RegisterServerEvent('md-drugs:server:startcook', function() local src = source if not GetRecipe(source, 'meth', 'cook', 'heat') then return end Notifys(src, "Adding Things To The Mix", "success") - Log(GetName(source) .. ' Started A Meth Batch', 'Meth') end) RegisterServerEvent('md-drugs:server:givemethingridients', function() @@ -25,7 +24,6 @@ end) RegisterServerEvent('md-drugs:server:getmeth', function() local src = source if not GetRecipe(src, 'meth', 'bag', 'bags') then return end - Log(GetName(src) .. ' Bagged 5 Of Meth', 'Meth') end) RegisterServerEvent('md-drugs:server:geteph', function(num) @@ -33,7 +31,6 @@ RegisterServerEvent('md-drugs:server:geteph', function(num) if not checkLoc(src, 'MethEph', num) then return end if AddItem(src, 'ephedrine', 1) then Notifys(src, 'Got Ephedrine!', "success") - Log(GetName(src) .. ' Got ' .. 1 .. 'Of Ephedrine', 'Meth') end end) @@ -42,6 +39,5 @@ RegisterServerEvent('md-drugs:server:getace', function(num) if not checkLoc(src, 'Methace', num) then return end if AddItem(src, 'acetone', 1) then Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth') - Notifys(src, 'Got Acetone!', "success") end end) \ No newline at end of file diff --git a/server/wholesale.lua b/server/wholesale.lua index 59c3f9e..4eda9f1 100644 --- a/server/wholesale.lua +++ b/server/wholesale.lua @@ -4,162 +4,62 @@ local crack = {"baggedcracked", "baggedcrackedstagetwo", "baggedcrackedstagethre local lsd = {'smiley_tabs', 'yinyang_tabs', 'wildcherry_tabs', 'pineapple_tabs', 'bart_tabs', 'gratefuldead_tabs'} local heroin = {'heroin_ready', 'heroin_readystagetwo', 'heroin_readystagethree'} local xtc = {"white_playboys", "white_playboys2", "white_playboys3", "white_playboys4", "blue_playboys", "blue_playboys2", "blue_playboys3", "blue_playboys4", "red_playboys", "red_playboys2", "red_playboys3", "red_playboys4", "orange_playboys", "orange_playboy2s", "orange_playboys3", "orange_playboys4", "white_aliens", "white_aliens2", "white_aliens3", "white_aliens4", "blue_aliens", "blue_aliens2", "blue_aliens3", "blue_aliens4", "red_aliens", "red_aliens3", "red_aliens2", "red_aliens4", "orange_aliens", "orange_aliens2", "orange_aliens3", "orange_aliens4", "white_pl", "white_pl2", "white_pl3", "white_pl4", "blue_pl", "blue_pl2", "blue_pl3", "blue_pl4", "red_pl", "red_pl2", "red_pl3", "red_pl4", "orange_pl", "orange_pl2", "orange_pl3", "orange_pl4", "white_trolls", "white_trolls2", "white_trolls3", "white_trolls4", "blue_trolls", "blue_trolls2", "blue_trolls3", "blue_trolls4", "red_trolls", "red_trolls2", "red_trolls3", "red_trolls4", "orange_trolls", "orange_trolls2", "orange_trolls3", "orange_trolls4", "white_cats2", "white_cats3", "white_cats4", "white_cats", "blue_cats", "blue_cats3", "blue_cats2", "blue_cats4", "red_cats", "red_cats2", "red_cats3", "red_cats4", "orange_cats", "orange_cats2", "orange_cats3", "orange_cats4" } - +local burners = {cokeburner = coke, crackburner = crack, lsdburner = lsd, heroinburner = heroin, xtcburner = xtc} +local active = {} local Price = { coke = {min = 20, max = 60}, crack = {min = 20, max = 60}, lsd = {min = 20, max = 60}, heroin = {min = 20, max = 60}, xtc = {min = 20, max = 60}, - } -QBCore.Functions.CreateUseableItem("cokeburner", function(source, item) - local src = source - local Player = getPlayer(source) - TriggerClientEvent("md-drugs:client:GetLocation", src, 'coke', "Bring Me All The Coke You Have") -end) +for k, v in pairs (burners) do + QBCore.Functions.CreateUseableItem(k, function(source, item) + local src = source + local Player = getPlayer(src) + for m, d in pairs (active) do + if d.cid == Player.PlayerData.citizenid then + return Notifys(src, 'You Already Have A Delivery To Make', 'error' ) + end + end + local tab = '' + if k == 'cokeburner' then tab = 'coke' end + if k == 'crackburner' then tab = 'crack' end + if k == 'lsdburner' then tab = 'lsd' end + if k == 'heroinburner' then tab = 'heroin' end + if k == 'xtcburner' then tab = 'xtc' end + if RemoveItem(src, k, 1) then + table.insert(active, { + src = src, + item = k, + location = getRandW(src), + cid = Player.PlayerData.citizenid, + type = v, + price = Price[tab] + }) + for m, d in pairs (active) do + if d.cid == Player.PlayerData.citizenid then + TriggerClientEvent("md-drugs:client:GetLocation", src, active[m]) + end + end + end + end) +end -RegisterServerEvent('md-drugs:server:wholesalecoke', function() - local src = source +RegisterNetEvent('md-drugs:server:SuccessSale', function(data) + local src = source local Player = getPlayer(src) - local price = math.random(Price['coke'].min, Price['coke'].max) - for k, v in pairs(coke) do - local item = Player.Functions.GetItemByName(v) - - if item and item.amount > 0 then - local removed = Player.Functions.RemoveItem(v, item.amount) - Player.Functions.AddMoney("cash", item.amount * price) - Notifys("You received " .. item.amount * price .. " Dollars!" , "success") - Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale') + for k, v in pairs (active) do + if v.cid == Player.PlayerData.citizenid then + local payout = math.random(v.price.min, v.price.max) + for m, d in pairs (v.type) do + local git = Player.Functions.GetItemByName(d) + if git and git.amount >= 1 then + RemoveItem(src, d, git.amount) + Player.Functions.AddMoney('cash', git.amount * payout) + end + table.remove(active, k) + end end end end) - -QBCore.Functions.CreateUseableItem("crackburner", function(source, item) - local src = source - local Player = getPlayer(source) - TriggerClientEvent("md-drugs:client:GetLocation", src, 'crack', "Bring Me All The Crack You Have") -end) - -RegisterServerEvent('md-drugs:server:wholesalecrack', function() - local src = source - local Player = getPlayer(src) - local price = math.random(Price['crack'].min, Price['crack'].max) - for k, v in pairs(crack) do - local item = Player.Functions.GetItemByName(v) - if item and item.amount > 0 then - local removed = Player.Functions.RemoveItem(v, item.amount) - Player.Functions.AddMoney("cash", item.amount * price) - Notifys("You received " .. item.amount * price .. " Dollars!" , "success") - Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale') - end - end -end) ------------------ lsd - -QBCore.Functions.CreateUseableItem("lsdburner", function(source, item) - local src = source - local Player = getPlayer(source) - TriggerClientEvent("md-drugs:client:GetLocation", src, 'lsd', "Bring Me All The lsd You Have") -end) - -RegisterServerEvent('md-drugs:server:wholesalelsd', function() - local src = source - local Player = getPlayer(src) - local price = math.random(Price['lsd'].min, Price['lsd'].max) - - for k, v in pairs(lsd) do - local item = Player.Functions.GetItemByName(v) - - if item and item.amount > 0 then - local removed = Player.Functions.RemoveItem(v, item.amount) - Player.Functions.AddMoney("cash", item.amount * price) - Notifys("You received " .. item.amount * price .. " Dollars!" , "success") - Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale') - end - end -end) ------------------ heroin - -QBCore.Functions.CreateUseableItem("heroinburner", function(source, item) - local src = source - local Player = getPlayer(source) - TriggerClientEvent("md-drugs:client:GetLocation", src, 'heroin', "Bring Me All The Heroin You Have") -end) - -RegisterServerEvent('md-drugs:server:wholesaleheroin', function() - local src = source - local Player = getPlayer(src) - local price = math.random(Price['heroin'].min, Price['heroin'].max) - for k, v in pairs(heroin) do - local item = Player.Functions.GetItemByName(v) - - if item and item.amount > 0 then - local removed = Player.Functions.RemoveItem(v, item.amount) - Player.Functions.AddMoney("cash", item.amount * price) - Notifys("You received " .. item.amount * price .. " Dollars!" , "success") - Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale') - end - end -end) ----- xtc -QBCore.Functions.CreateUseableItem("xtcburner", function(source, item) - local src = source - local Player = getPlayer(source) - TriggerClientEvent("md-drugs:client:GetLocation", src, 'xtc', "Bring Me All The xtc You Have") -end) - -RegisterServerEvent('md-drugs:server:wholesalextc', function() - local src = source - local Player = getPlayer(src) - local price = math.random(Price['xtc'].min, Price['xtc'].max) - for k, v in pairs(xtc) do - local item = Player.Functions.GetItemByName(v) - - if item and item.amount > 0 then - local removed = Player.Functions.RemoveItem(v, item.amount) - Player.Functions.AddMoney("cash", item.amount * price) - Notifys("You received " .. item.amount * price .. " Dollars!" , "success") - Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale') - end - end -end) - - -RegisterServerEvent('md-drugs:server:RemoveBurner', function(item) - local src = source - local Player = getPlayer(src) - - if item == 'coke' then - if Player.Functions.RemoveItem('cokeburner', 1) then - else - DropPlayer(src, 'How Did You Trigger The Event Without The Item?') - end - elseif item == 'crack' then - if Player.Functions.RemoveItem('crackburner', 1) then - else - DropPlayer(src, 'How Did You Trigger The Event Without The Item?') - end - elseif item == 'heroin' then - if Player.Functions.RemoveItem('heroinburner', 1) then - else - DropPlayer(src, 'How Did You Trigger The Event Without The Item?') - end - elseif item == 'lsd' then - if Player.Functions.RemoveItem('lsdburner', 1) then - else - DropPlayer(src, 'How Did You Trigger The Event Without The Item?') - end - elseif item == 'xtc' then - if Player.Functions.RemoveItem('xtcburner', 1) then - else - DropPlayer(src, 'How Did You Trigger The Event Without The Item?') - end - end -end) - - - - - - diff --git a/server/xtc.lua b/server/xtc.lua index 43af67d..a37c94c 100644 --- a/server/xtc.lua +++ b/server/xtc.lua @@ -40,7 +40,6 @@ local check, loc = lib.callback.await('md-drugs:client:setpress', src, v.data) }) end end - print(json.encode(activePresses)) end) end From e83cddd96f0fbe9badb6b2be2c680fef0b06beec Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 23 Nov 2024 02:21:39 -0800 Subject: [PATCH 15/36] updated pharma to utilize nearby Players and give them the prescription directly --- client/pharma.lua | 34 ++++++++++++---------------------- server/pharma.lua | 25 +++++++++++++++---------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/client/pharma.lua b/client/pharma.lua index 404cd07..4a6ca40 100644 --- a/client/pharma.lua +++ b/client/pharma.lua @@ -1,27 +1,17 @@ local QBCore = exports['qb-core']:GetCoreObject() -RegisterNetEvent("md-drugs:client:prescriptionpad", function(args) -local icon, event = 'fa-solid fa-file-prescription', 'md-drugs:client:writeprescription' -if QBCore.Functions.GetPlayerData().job.type == Config.PharmaJob then - lib.registerContext({ - id = 'prescriptionpad', - title = "Prescription Pad", - options = { - {title = 'Give Vics', description = 'Give Vics ', icon = icon, event = event, args = {item = 'vicodin_prescription'}}, - {title = 'Give Madderal', description = 'Give Madderal ', icon = icon, event = event, args = {item = 'adderal_prescription'}}, - {title = 'Give Morphin', description = 'Give Morphin ', icon = icon, event = event, args = {item = 'morphine_prescription'}}, - {title = 'Give Zany', description = 'Give Zany ', icon = icon, event = event, args = {item = 'xanax_prescription'} }, - } - }) - lib.showContext('prescriptionpad') -else - Notify(Lang.Pharma.notems, "error") -end -end) - -RegisterNetEvent("md-drugs:client:writeprescription", function(args) - if not progressbar(Lang.Pharma.write, 4000, 'notepad') then return end - TriggerServerEvent("md-drugs:server:giveprescription", args.item) +lib.callback.register("md-drugs:client:prescriptionpad", function(data) + if not QBCore.Functions.GetPlayerData().job.type == 'ems' then return end + local input = lib.inputDialog('Who To Give A Prescription To?',{ + {type = 'select', label = 'Player Name', options = data}, + {type = 'select', label = 'Prescription', options = { + {label = 'Vicodin', value = 'vicodin_prescription'}, + {label = 'Adderal', value = 'adderal_prescription'}, + {label = 'Morphine', value = 'morphine_prescription'}, + {label = 'Xanax', value = 'xanax_prescription'} + }}}) + if not progressbar(Lang.Pharma.write, 4000, 'notepad') then return end + return {who = input[1], what = input[2]} end) RegisterNetEvent("md-drugs:client:fillprescription", function(data) diff --git a/server/pharma.lua b/server/pharma.lua index 0c80fc9..5453820 100644 --- a/server/pharma.lua +++ b/server/pharma.lua @@ -12,17 +12,22 @@ end QBCore.Functions.CreateUseableItem('prescription_pad', function(source, item) local src = source - if GetJob(src) then - TriggerClientEvent("md-drugs:client:prescriptionpad", src, item) - end -end) + local Player = getPlayer(src) + local name = GetName(src) + local near = {} -RegisterServerEvent('md-drugs:server:giveprescription', function(item) - local src = source - if GetJob(src) then - AddItem(src, item, 1) - Log(GetName(src) .. ' Made A Prescription Of ' .. item .. '!', 'pharma') - end + if GetJob(src) then + for k, v in pairs (QBCore.Functions.GetQBPlayers()) do + local targ = QBCore.Functions.GetPlayerByCitizenId(v.PlayerData.citizenid) + local tname = GetName(v.PlayerData.source) + table.insert(near, {label = tname, value = targ.PlayerData.citizenid}) + end + local data = lib.callback.await('md-drugs:client:prescriptionpad', src, near) + if type(data) == 'table' then + local give = QBCore.Functions.GetPlayerByCitizenId(data.who) + AddItem(give.PlayerData.source, data.what, 1) + end + end end) RegisterServerEvent('md-drugs:server:unbottle', function(item) From f1ed2c0860154ce9058b65c93ccc85d1fc5b2a44 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 23 Nov 2024 02:55:09 -0800 Subject: [PATCH 16/36] ree --- client/crack.lua | 3 --- server/pharma.lua | 2 -- 2 files changed, 5 deletions(-) diff --git a/client/crack.lua b/client/crack.lua index c10d4e1..d7a9f14 100644 --- a/client/crack.lua +++ b/client/crack.lua @@ -1,6 +1,5 @@ local QBCore = exports['qb-core']:GetCoreObject() - 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 @@ -8,8 +7,6 @@ RegisterNetEvent("md-drugs:client:makecrackone", function(data) TriggerServerEvent("md-drugs:server:makecrackone", data.data) end) - - RegisterNetEvent("md-drugs:client:bagcrack", function(data) if not ItemCheck('empty_weed_bag') then return end if not progressbar(Lang.Crack.bagcrack, 4000, 'uncuff') then return end diff --git a/server/pharma.lua b/server/pharma.lua index 5453820..423ec0f 100644 --- a/server/pharma.lua +++ b/server/pharma.lua @@ -12,8 +12,6 @@ end QBCore.Functions.CreateUseableItem('prescription_pad', function(source, item) local src = source - local Player = getPlayer(src) - local name = GetName(src) local near = {} if GetJob(src) then From cf5cfba909f4e1ea474b66a149430cc3d21a1611 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 23 Nov 2024 14:38:23 -0800 Subject: [PATCH 17/36] patch for pharma, new callback to do animations and progressbar checks --- client/functions.lua | 5 +++ client/pedspawns.lua | 3 +- client/pharma.lua | 17 +++------- client/weed.lua | 16 +++++----- server/locations.lua | 2 +- server/pharma.lua | 76 ++++++++++++++++++++++---------------------- server/weed.lua | 12 +++---- 7 files changed, 63 insertions(+), 68 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 55e380c..252b5a1 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -640,4 +640,9 @@ CreateThread(function() TriggerEvent('Mescaline:init') TriggerEvent('shrooms:init') TriggerEvent('weed:init') +end) + +lib.callback.register('md-drugs:client:uncuff', function() + if not progressbar('Uncuffing', 4000, 'uncuff') then return end + return true end) \ No newline at end of file diff --git a/client/pedspawns.lua b/client/pedspawns.lua index b167c9b..b1a40b8 100644 --- a/client/pedspawns.lua +++ b/client/pedspawns.lua @@ -1,7 +1,7 @@ local QBCore = exports['qb-core']:GetCoreObject() CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) - local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01'} + 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 lib.requestModel(v, Config.RequestModelTime) end @@ -20,4 +20,5 @@ CreateThread(function() AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil ) AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fas fa-eye", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil) AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fas fa-eye", action = function() Notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil ) + end) \ No newline at end of file diff --git a/client/pharma.lua b/client/pharma.lua index 4a6ca40..1970137 100644 --- a/client/pharma.lua +++ b/client/pharma.lua @@ -1,15 +1,10 @@ local QBCore = exports['qb-core']:GetCoreObject() -lib.callback.register("md-drugs:client:prescriptionpad", function(data) +lib.callback.register("md-drugs:client:prescriptionpad", function(data, op) if not QBCore.Functions.GetPlayerData().job.type == 'ems' then return end local input = lib.inputDialog('Who To Give A Prescription To?',{ {type = 'select', label = 'Player Name', options = data}, - {type = 'select', label = 'Prescription', options = { - {label = 'Vicodin', value = 'vicodin_prescription'}, - {label = 'Adderal', value = 'adderal_prescription'}, - {label = 'Morphine', value = 'morphine_prescription'}, - {label = 'Xanax', value = 'xanax_prescription'} - }}}) + {type = 'select', label = 'Prescription', options = op}}) if not progressbar(Lang.Pharma.write, 4000, 'notepad') then return end return {who = input[1], what = input[2]} end) @@ -19,11 +14,7 @@ RegisterNetEvent("md-drugs:client:fillprescription", function(data) TriggerServerEvent("md-drugs:server:fillprescription", data.data) end) -RegisterNetEvent("md-drugs:client:unbottle", function(item) +lib.callback.register("md-drugs:client:unbottle", function() if not progressbar(Lang.Pharma.open, 4000, 'uncuff') then return end - if item.name == 'vicodinbottle' then item = 'vicodin' end - if item.name == 'adderalbottle' then item = 'adderal' end - if item.name == 'morphinebottle' then item = 'morphine' end - if item.name == 'xanaxbottle' then item = 'xanax' end - TriggerServerEvent('md-drugs:server:unbottle', item) + return true end) diff --git a/client/weed.lua b/client/weed.lua index 1199399..eb5a0a8 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -125,6 +125,12 @@ AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, { if hasJob() and exploded == false then return true end end, } ) + local stove = CreateObject("prop_cooker_03",config.singleSpot.MakeButter.x, config.singleSpot.MakeButter.y, config.singleSpot.MakeButter.z-1, true, false) + SetEntityHeading(stove, 270.00) + FreezeEntityPosition(stove, true) + local stove2 = CreateObject("prop_cooker_03",config.singleSpot.MakeOil.x,config.singleSpot.MakeOil.y, config.singleSpot.MakeOil.z-1, true, false) + SetEntityHeading(stove2, 90.00) + FreezeEntityPosition(stove2, true) end) CreateThread(function() @@ -137,12 +143,6 @@ CreateThread(function() BikerWeedFarm.Plant4.Clear(false) BikerWeedFarm.Plant5.Clear(false) BikerWeedFarm.Plant6.Clear(false) BikerWeedFarm.Plant7.Clear(false) BikerWeedFarm.Plant8.Clear(false) BikerWeedFarm.Plant9.Clear(false) RefreshInterior(BikerWeedFarm.interiorId) - local stove = CreateObject("prop_cooker_03",vector3(1045.49, -3198.46, -38.15-1), true, false) - SetEntityHeading(stove, 270.00) - FreezeEntityPosition(stove, true) - local stove2 = CreateObject("prop_cooker_03",vector3(1038.90, -3198.66, -38.17-1), true, false) - SetEntityHeading(stove2, 90.00) - FreezeEntityPosition(stove2, true) end) @@ -155,7 +155,7 @@ RegisterNetEvent("md-drugs:client:grind", function() end) RegisterNetEvent("md-drugs:client:dodabs", function() -if not progressbar('Doing Dabs', 4000, 'bong2') then return end +if not progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end AlienEffect() end) @@ -207,4 +207,4 @@ end) RegisterNetEvent('md-drugs:client:rollBlunt', function(data) lib.showContext('mddrugsblunts') -end) +end) \ No newline at end of file diff --git a/server/locations.lua b/server/locations.lua index ae74aa5..198e33e 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -50,7 +50,7 @@ local Target = { {loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, }, FillPrescription = { -- where to fill out your prescription - {loc = vector3(2432.89, 4252.2, 36.35), 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 = { cutcoke = vector3(1093.17, -3195.74, -39.19), diff --git a/server/pharma.lua b/server/pharma.lua index 423ec0f..1f29033 100644 --- a/server/pharma.lua +++ b/server/pharma.lua @@ -13,64 +13,64 @@ end QBCore.Functions.CreateUseableItem('prescription_pad', function(source, item) local src = source local near = {} - if GetJob(src) then for k, v in pairs (QBCore.Functions.GetQBPlayers()) do local targ = QBCore.Functions.GetPlayerByCitizenId(v.PlayerData.citizenid) local tname = GetName(v.PlayerData.source) - table.insert(near, {label = tname, value = targ.PlayerData.citizenid}) + local ped, tped = GetPlayerPed(src), GetPlayerPed(v.PlayerData.source) + local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped)) + if dist < 5.0 then + table.insert(near, {label = tname, value = targ.PlayerData.citizenid}) + end end - local data = lib.callback.await('md-drugs:client:prescriptionpad', src, near) + 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) if type(data) == 'table' then local give = QBCore.Functions.GetPlayerByCitizenId(data.who) - AddItem(give.PlayerData.source, data.what, 1) + for i = 1, #options do + if data.what == options[i].value then + AddItem(give.PlayerData.source, data.what, 1) + end + end end - end -end) - -RegisterServerEvent('md-drugs:server:unbottle', function(item) - local src = source - local amount = math.random(10,30) - AddItem(src, item, amount) - Log(GetName(src) .. ' Unbottled '.. amount .. ' Of ' .. item .. '!', 'pharma') + end end) local pharmabottle = {'vicodinbottle', 'adderalbottle','morphinebottle','xanaxbottle'} for m, d in pairs (pharmabottle) do QBCore.Functions.CreateUseableItem(d, function(source, item) local src = source - if RemoveItem(src, d, 1) then - TriggerClientEvent("md-drugs:client:unbottle", src, item) - end + local Player = getPlayer(src) + local check = lib.callback.await("md-drugs:client:unbottle", src) + if check then + local get = { + ['vicodinbottle'] = 'vicodin', + ['adderalbottle'] = 'adderal', + ['morphinebottle'] = 'morphine', + ['xanaxbottle'] = 'xanax' + } + for k, v in pairs (get) do + if d == k then + RemoveItem(src, d, 1) + AddItem(src, v, math.random(10,30)) + Notifys(src,Lang.Pharma.unbottle, "success") + Log(GetName(src) .. ' Unbottled 30 Of ' .. v .. '!', 'pharma') + end + end + end end) end - RegisterServerEvent('md-drugs:server:fillprescription', function() local src = source local Player = getPlayer(src) - local vic = Player.Functions.GetItemByName('vicodin_prescription') - local add = Player.Functions.GetItemByName('adderal_prescription') - local mor = Player.Functions.GetItemByName('morphine_prescription') - local xan = Player.Functions.GetItemByName('xanax_prescription') - if vic then - RemoveItem(src,'vicodin_prescription', 1 ) - AddItem(src,'vicodinbottle', 1) - Notifys(src,Lang.Pharma.pills, "success") - elseif add then - RemoveItem(src,'adderal_prescription', 1 ) - AddItem(src,'adderalbottle', 1) - Notifys(src,Lang.Pharma.pills, "success") - elseif mor then - RemoveItem(src,'morphine_prescription', 1 ) - AddItem(src,'morphinebottle', 1) - Notifys(src,Lang.Pharma.pills, "success") - elseif xan then - RemoveItem(src,'xanax_prescription', 1 ) - AddItem(src,'xanaxbottle', 1) - Notifys(src,Lang.Pharma.pills, "success") - else - Notifys(src,Lang.Pharma.no, "error") + local pres = {vicodin_prescription = 'vicodinbottle', adderal_prescription = 'adderalbottle', morphine_prescription = 'morphinebottle', xanax_prescription = 'xanaxbottle'} + for k, v in pairs (pres) do + if Player.Functions.GetItemByName(k) then + RemoveItem(src, k, 1 ) + AddItem(src,v, 1) + break + end end Log(GetName(src) .. ' Filled A Prescription!', 'pharma') end) diff --git a/server/weed.lua b/server/weed.lua index 7958cb3..9327ff1 100644 --- a/server/weed.lua +++ b/server/weed.lua @@ -115,7 +115,6 @@ local Player = getPlayer(src) if Player.Functions.GetItemByName("butanetorch") then if RemoveItem(src, "shatter", 1) then - Notifys(src, 'test', 'success') TriggerClientEvent("md-drugs:client:dodabs", src) end end @@ -123,9 +122,10 @@ end) QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item) local src = source + local check = lib.callback.await('md-drugs:client:uncuff', src) + if not check then return end if RemoveItem(src, "drycannabis",1 ) then AddItem(src, "grindedweed", 1) - TriggerClientEvent("md-drugs:client:grind", src) else Notifys(src,'You Need Dried Weed', 'error') end @@ -134,12 +134,10 @@ end) QBCore.Functions.CreateUseableItem("mdwoods", function(source, item) local src = source local Player = getPlayer(src) - TriggerClientEvent("md-drugs:client:rollanim", src) - Wait(4000) + local check = lib.callback.await('md-drugs:client:uncuff', src) + if not check then return end if RemoveItem(src, "mdwoods",1 ) then AddItem(src, "bluntwrap", 5) AddItem(src, "tobacco", 5) end -end) - - +end) \ No newline at end of file From 001378704c57f1ce5ee0acf04e425772657ac442 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 23 Nov 2024 15:33:17 -0800 Subject: [PATCH 18/36] updated deliveries to be server sided and adjusted all locations to vec4 --- client/deliveries.lua | 5 +- server/deliveries.lua | 112 +++++++++++++++++++++++++++++++++----- shared/config.lua | 7 ++- shared/qbdrugsrewrite.lua | 88 +----------------------------- 4 files changed, 108 insertions(+), 104 deletions(-) diff --git a/client/deliveries.lua b/client/deliveries.lua index 99d95f2..4ac5717 100644 --- a/client/deliveries.lua +++ b/client/deliveries.lua @@ -44,8 +44,8 @@ RegisterNetEvent('md-drugs:client:setLocation', function(data) SetNewWaypoint(coord.x, coord.y) if isActive then return end isActive = true - local Buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, 180.0, false, false) - Freeze(Buyer, true, 180) + local Buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, coord.w, false, false) + Freeze(Buyer, true, coord.w) AddSingleModel(Buyer, { icon = 'fas fa-user-secret', label = Lang.targets.Delivery.hand, @@ -62,4 +62,3 @@ RegisterNetEvent('md-drugs:client:setLocation', function(data) end }, nil) end) - diff --git a/server/deliveries.lua b/server/deliveries.lua index 2c80f91..d39b8b8 100644 --- a/server/deliveries.lua +++ b/server/deliveries.lua @@ -1,7 +1,86 @@ -QBCore = exports['qb-core']:GetCoreObject() +local QBCore = exports['qb-core']:GetCoreObject() - --- Callbacks +local dloc = { + {coords = vector4(282.48, -1814.32, 27.23, 145.11)}, + {coords = vector4(-296.11, -1300.65, 31.31, 270.87)}, + {coords = vector4(-36.64, -1492.04, 31.22, 151.91)}, + {coords = vector4(282.48, -1814.32, 27.23, 232.19)}, + {coords = vector4(54.54, -1873.22, 22.81, 131.47)}, + {coords = vector4(-269.34, -2437.25, 6.40, 252.67)}, + {coords = vector4(269.19, -3248.55, 5.79, 252.67)}, + {coords = vector4(632.94, -3015.44, 7.34, 3.44)}, + {coords = vector4(1049.55, -2427.88, 30.30, 79.52)}, + {coords = vector4(853.16, -2207.32, 30.68, 284.88)}, + {coords = vector4(903.10, -1721.98, 32.25, 168.71)}, + {coords = vector4(1289.30, -1710.49, 55.48, 208.57)}, + {coords = vector4(1412.01, -1490.53, 60.66, 132.46)}, + {coords = vector4(734.26, -1311.26, 27.01, 102.99)}, + {coords = vector4(1231.60, -1083.06, 38.53, 102.99)}, + {coords = vector4(1143.55, -1000.19, 45.32, 257.05)}, + {coords = vector4(1264.82, -702.87, 64.72, 257.05)}, + {coords = vector4(1119.65, -639.76, 56.81, 284.53)}, + {coords = vector4(1129.59, -462.59, 66.49, 79.23)}, + {coords = vector4(42.80, -811.45, 31.43, 79.23)}, + {coords = vector4(-509.48, -1001.66, 23.55, 79.23)}, + {coords = vector4(-830.97, -862.41, 20.69, 13.72)}, + {coords = vector4(-1320.26, -1177.34, 4.89, 74.29)}, + {coords = vector4(-1097.63, -1673.24, 8.40, 136.51)}, + {coords = vector4(-1147.61, -1452.10, 4.60, 51.50)}, + {coords = vector4(-1241.69, -1208.39, 8.52, 107.56)}, + {coords = vector4(-1876.92, -584.44, 11.85, 329.54)}, + {coords = vector4(-1303.94, -441.39, 35.22, 128.73)}, + {coords = vector4(-1705.48, -433.46, 42.17, 128.73)}, + {coords = vector4(-1305.99, 336.35, 65.50, 35.13)}, + {coords = vector4(-741.80, 484.84, 109.47, 110.85)}, + {coords = vector4(-409.57, 341.49, 108.91, 270.45)}, + {coords = vector4(-126.44, 588.18, 204.71, 8.12)}, + {coords = vector4(211.42, -101.42, 73.28, 174.10)}, + {coords = vector4(490.61, -95.04, 66.44, 273.57)}, + {coords = vector4(387.19, -993.59, 29.42, 273.57)}, + {coords = vector4(-500.47, -712.37, 33.21, 273.57)}, + {coords = vector4(2572.20, 479.97, 108.68, 80.27)}, + {coords = vector4(-430.10, 1205.41, 325.76, 169.25)}, + {coords = vector4(-126.06, 1896.58, 197.33, 169.25)}, + {coords = vector4(-2521.08, 2310.31, 33.22, 276.87)}, + {coords = vector4(1129.01, 2125.14, 55.55, 276.87)}, + {coords = vector4(1546.64, 2166.56, 78.72, 100.37)}, + {coords = vector4(404.34, 2584.54, 43.52, 100.37)}, + {coords = vector4(180.15, 2792.99, 45.66, 283.04)}, + {coords = vector4(287.67, 2843.89, 44.70, 118.41)}, + {coords = vector4(2030.23, 3184.42, 45.13, 146.06)}, + {coords = vector4(2175.33, 3321.92, 46.13, 214.53)}, + {coords = vector4(2389.61, 3340.98, 47.34, 214.52)}, + {coords = vector4(1716.25, 3295.08, 41.26, 196.21)}, + {coords = vector4(1779.38, 3640.83, 34.50, 24.16)}, + {coords = vector4(1894.59, 3715.34, 32.75, 127.89)}, + {coords = vector4(1861.90, 3857.15, 36.27, 293.45)}, + {coords = vector4(996.38, 3575.07, 34.61, 328.30)}, + {coords = vector4(387.45, 3584.73, 33.29, 351.41)}, + {coords = vector4(68.08, 3693.22, 40.66, 63.98)}, + {coords = vector4(15.55, 3688.70, 39.81, 230.89)}, + {coords = vector4(2566.59, 4283.34, 41.97, 348.53)}, + {coords = vector4(2570.82, 4667.95, 34.08, 135.30)}, + {coords = vector4(2882.05, 4511.72, 48.02, 66.58)}, + {coords = vector4(2243.78, 5154.02, 57.89, 139.42)}, + {coords = vector4(1642.91, 4846.08, 45.51, 109.83)}, + {coords = vector4(1308.87, 4362.17, 41.55, 256.01)}, + {coords = vector4(-1090.27, 4940.57, 214.13, 256.01)}, + {coords = vector4(-552.37, 5348.37, 74.76, 62.18)}, + {coords = vector4(-679.02, 5834.27, 17.33, 137.18)}, + {coords = vector4(-481.97, 6276.93, 13.35, 323.16)}, + {coords = vector4(-24.92, 6472.60, 31.49, 144.42)}, + {coords = vector4(36.03, 6549.18, 31.43, 287.85)}, + {coords = vector4(406.08, 6526.43, 27.75, 97.45)}, + {coords = vector4(1522.39, 6329.23, 24.61, 331.71)}, + {coords = vector4(1741.39, 6419.62, 35.04, 331.71)}, + {coords = vector4(3426.72, 5174.42, 7.40, 112.64)}, + {coords = vector4(2525.99, 2586.62, 38.94, 257.02)}, + {coords = vector4(2696.29, 1664.44, 24.52, 70.12)}, + {coords = vector4(106.24, -1280.32, 29.24, 350.89)}, + {coords = vector4(223.98, 121.53, 102.76, 259.68)}, + {coords = vector4(102.19, -255.02, 50.05, 83.59)}, + +} lib.callback.register('md-drugs:server:getDealers', function(data) local check = MySQL.query.await('SELECT * FROM dealers', {}) local loc = json.encode({x = 899.98, y = -2603.24, z = 6.11, h = 176.12 }) @@ -16,29 +95,36 @@ lib.callback.register('md-drugs:server:getDealers', function(data) end) +local DeliveryItems = { + { item = "weed_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) local src = source local Player = getPlayer(src) - local item = math.random(1, #QBConfig.DeliveryItems) + local itemnum = math.random(1, #DeliveryItems) + local item = DeliveryItems[itemnum].item local amount = math.random(1,4) local check = MySQL.query.await('SELECT * FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) - local locnum = math.random(1, #QBConfig.DeliveryLocations) + local locnum = math.random(1, #dloc) local coord = json.encode({ - x = math.floor(QBConfig.DeliveryLocations[locnum].coords.x * 100) / 100, - y = math.floor(QBConfig.DeliveryLocations[locnum].coords.y * 100) / 100, - z = math.floor(QBConfig.DeliveryLocations[locnum].coords.z * 100) / 100, + x = dloc[locnum].coords.x, + y = dloc[locnum].coords.y, + z = dloc[locnum].coords.z , + w = dloc[locnum].coords.w }) if not check[1] then MySQL.insert('INSERT INTO deliveriesdealer SET cid = ?, itemdata = ?, timestart = ?, maxtime = ?, location = ?', - {Player.PlayerData.citizenid, json.encode({item = QBConfig.DeliveryItems[item].item, amount = amount}), os.time(), os.time() + (15 * 60), coord }) - AddItem(Player.PlayerData.source, QBConfig.DeliveryItems[item].item, amount) - return true, QBConfig.DeliveryItems[item].item, amount, coord + {Player.PlayerData.citizenid, json.encode({item = item, amount = amount}), os.time(), os.time() + (15 * 60), coord }) + AddItem(Player.PlayerData.source, item, amount) + return true, item, amount, coord else local time = os.time() local timeout = math.floor(os.difftime(time, check[1].maxtime) / 60) if timeout > 15 then MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) Notifys(src, 'You Failed To Make It In Time!', 'error' ) return false end - Notifys(src,'You Already Have A Delivery To Make', 'error' ) return false, QBConfig.DeliveryItems[item].item, amount, coord + Notifys(src,'You Already Have A Delivery To Make', 'error' ) return false, item, amount, coord end end) @@ -54,7 +140,7 @@ RegisterNetEvent('md-drugs:server:giveDeliveryItems', function(item, amount) if item ~= itemData.item then return end if amount ~= itemData.amount then return end if RemoveItem(src, item, amount) then - for k, v in pairs (QBConfig.DeliveryItems) do + for k, v in pairs (DeliveryItems) do if v.item == item then local income = math.random(v.payout.min, v.payout.max) Player.Functions.AddMoney('cash', income) diff --git a/shared/config.lua b/shared/config.lua index fa577bc..667cef0 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -1,7 +1,7 @@ Config = {} --Ignore. Config.Target = 'ox' -- qb or ox -Config.respawnTime = 600 -- Seconds +Config.respawnTime = 150 -- Seconds 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.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total @@ -47,4 +47,7 @@ Config.Minigames = { glspot = {gridSize = 6, timeLimit = 999999, charSet = "alphabet", required = 10}, glmath = {timeLimit = 300000}, } -Config.minigametype = 'blrapidlines' -- look above for options or choose none if you dont want any minigames \ No newline at end of file +Config.minigametype = 'blrapidlines' -- look above for options or choose none if you dont want any minigames + +-------- Woah Where did like all the locations go? +--- read the readme to find out \ No newline at end of file diff --git a/shared/qbdrugsrewrite.lua b/shared/qbdrugsrewrite.lua index 96139e3..3b0a6b8 100644 --- a/shared/qbdrugsrewrite.lua +++ b/shared/qbdrugsrewrite.lua @@ -8,92 +8,8 @@ QBConfig.CustomDirtyMoney = false QBConfig.CustomDirtyMoneyitem = '' QBConfig.Dealers = {} -QBConfig.DeliveryItems = { - { item = "weed_brick", minrep = 0, payout = {min = 10, max = 50}}, - { item = "coke_brick", minrep = 0, payout = {min = 10, max = 50}}, -} - -QBConfig.DeliveryLocations = { - [1] = { ["label"] = "Pork Factory", ["coords"] = vector3(-296.27, -1300.54, 31.31),}, - [2] = { ["label"] = "Forum Drive Deli", ["coords"] = vector3(-36.69, -1492.13, 31.22),}, - [3] = { ["label"] = "Hayes Autos South LS", ["coords"] = vector3(282.55, -1814.39, 27.1),}, - [4] = { ["label"] = "Grove Street", ["coords"] = vector3(54.55, -1873.15, 22.8),}, - [5] = { ["label"] = "Port1", ["coords"] = vector3(-269.4, -2437.15, 6.36),}, - [6] = { ["label"] = "Port2", ["coords"] = vector3(269.16, -3248.54, 5.79),}, - [7] = { ["label"] = "Port3", ["coords"] = vector3(632.9, -3015.42, 7.34),}, - [8] = { ["label"] = "Industrial1", ["coords"] = vector3(1049.52, -2427.96, 30.3),}, - [9] = { ["label"] = "Industrial2", ["coords"] = vector3(853.26, -2207.3, 30.68),}, - [10] = { ["label"] = "Industrial3", ["coords"] = vector3(903.02, -1721.94, 32.18),}, - [11] = { ["label"] = "EastLS1", ["coords"] = vector3(1289.33, -1710.47, 55.51),}, - [12] = { ["label"] = "EastLS2", ["coords"] = vector3(1411.94, -1490.54, 60.66),}, - [13] = { ["label"] = "Industrial4", ["coords"] = vector3(734.26, -1311.26, 27.01),}, - [14] = { ["label"] = "Industrial5", ["coords"] = vector3(1231.6, -1083.06, 38.53),}, - [15] = { ["label"] = "Mirror1", ["coords"] = vector3(1143.55, -1000.19, 45.32),}, - [16] = { ["label"] = "Mirror2", ["coords"] = vector3(1264.82, -702.87, 64.72),}, - [17] = { ["label"] = "Mirror3", ["coords"] = vector3(1119.65, -639.76, 56.81),}, - [18] = { ["label"] = "Mirror4", ["coords"] = vector3(1129.59, -462.59, 66.49),}, - [19] = { ["label"] = "City1", ["coords"] = vector3(42.8, -811.45, 31.43),}, - [20] = { ["label"] = "City2", ["coords"] = vector3(-509.48, -1001.66, 23.55),}, - [21] = { ["label"] = "City3", ["coords"] = vector3(-830.97, -862.41, 20.69),}, - [22] = { ["label"] = "Vesp1", ["coords"] = vector3(-1320.26, -1177.34, 4.89),}, - [23] = { ["label"] = "Vesp2", ["coords"] = vector3(-1097.63, -1673.24, 8.4),}, - [24] = { ["label"] = "Vesp3", ["coords"] = vector3(-1147.61, -1452.1, 4.6),}, - [25] = { ["label"] = "Vesp4", ["coords"] = vector3(-1241.69, -1208.39, 8.52),}, - [26] = { ["label"] = "Vesp5", ["coords"] = vector3(-1876.92, -584.44, 11.85),}, - [27] = { ["label"] = "City4", ["coords"] = vector3(-1303.94, -441.39, 35.22),}, - [28] = { ["label"] = "City5", ["coords"] = vector3(-1705.48, -433.46, 42.17),}, - [29] = { ["label"] = "City6", ["coords"] = vector3(-1305.99, 336.35, 65.5),}, - [30] = { ["label"] = "Vinewood1", ["coords"] = vector3(-741.8, 484.84, 109.47),}, - [31] = { ["label"] = "Vinewood2", ["coords"] = vector3(-409.57, 341.49, 108.91),}, - [32] = { ["label"] = "Vinewood3", ["coords"] = vector3(-126.44, 588.18, 204.71),}, - [33] = { ["label"] = "Vinewood4", ["coords"] = vector3(211.42, -101.42, 73.28),}, - [34] = { ["label"] = "Vinewood5", ["coords"] = vector3(490.61, -95.04, 66.44),}, - [35] = { ["label"] = "City7", ["coords"] = vector3(387.19, -993.59, 29.42),}, - [36] = { ["label"] = "City8", ["coords"] = vector3(-500.47, -712.37, 33.21),}, - [37] = { ["label"] = "EastHW", ["coords"] = vector3(2572.2, 479.97, 108.68),}, - [38] = { ["label"] = "Vinewood6", ["coords"] = vector3(-430.1, 1205.41, 325.76),}, - [39] = { ["label"] = "VinewoodHills1", ["coords"] = vector3(-126.06, 1896.58, 197.33),}, - [40] = { ["label"] = "VinewoodHills2", ["coords"] = vector3(-2521.08, 2310.31, 33.22),}, - [41] = { ["label"] = "RedwoodsCons", ["coords"] = vector3(1129.01, 2125.14, 55.55),}, - [42] = { ["label"] = "RedwoodsFarm", ["coords"] = vector3(1546.64, 2166.56, 78.72),}, - [43] = { ["label"] = "Harmony1", ["coords"] = vector3(404.34, 2584.54, 43.52),}, - [44] = { ["label"] = "Harmony2", ["coords"] = vector3(180.15, 2792.99, 45.66),}, - [45] = { ["label"] = "Harmony3", ["coords"] = vector3(287.67, 2843.89, 44.7),}, - [46] = { ["label"] = "Sandy1", ["coords"] = vector3(2030.23, 3184.42, 45.13),}, - [47] = { ["label"] = "Sandy2", ["coords"] = vector3(2175.33, 3321.92, 46.13),}, - [48] = { ["label"] = "Sandy3", ["coords"] = vector3(2389.61, 3340.98, 47.34),}, - [49] = { ["label"] = "Sandy4", ["coords"] = vector3(1716.25, 3295.08, 41.26),}, - [50] = { ["label"] = "Sandy5", ["coords"] = vector3(1779.38, 3640.83, 34.5),}, - [51] = { ["label"] = "Sandy6", ["coords"] = vector3(1894.59, 3715.34, 32.75),}, - [52] = { ["label"] = "Sandy7", ["coords"] = vector3(1861.9, 3857.15, 36.27),}, - [53] = { ["label"] = "Sandy8", ["coords"] = vector3(996.38, 3575.07, 34.61),}, - [54] = { ["label"] = "Sandy9", ["coords"] = vector3(387.45, 3584.73, 33.29),}, - [55] = { ["label"] = "Stab1", ["coords"] = vector3(68.08, 3693.22, 40.66),}, - [56] = { ["label"] = "Stab2", ["coords"] = vector3(15.55, 3688.7, 39.81),}, - [57] = { ["label"] = "Sandy10", ["coords"] = vector3(2566.59, 4283.34, 41.97),}, - [58] = { ["label"] = "Grape1", ["coords"] = vector3(2570.82, 4667.95, 34.08),}, - [59] = { ["label"] = "Grape2", ["coords"] = vector3(2882.05, 4511.72, 48.02),}, - [60] = { ["label"] = "Grape3", ["coords"] = vector3(2243.78, 5154.02, 57.89),}, - [61] = { ["label"] = "Grape4", ["coords"] = vector3(1642.91, 4846.08, 45.51),}, - [62] = { ["label"] = "Grape5", ["coords"] = vector3(1308.87, 4362.17, 41.55),}, - [63] = { ["label"] = "Paleto1", ["coords"] = vector3(-1090.27, 4940.57, 214.13),}, - [64] = { ["label"] = "Paleto2", ["coords"] = vector3(-552.37, 5348.37, 74.76),}, - [65] = { ["label"] = "Paleto3", ["coords"] = vector3(-679.02, 5834.27, 17.33),}, - [66] = { ["label"] = "Paleto4", ["coords"] = vector3(-481.97, 6276.93, 13.35),}, - [67] = { ["label"] = "Paleto5", ["coords"] = vector3(-24.92, 6472.6, 31.49),}, - [68] = { ["label"] = "Paleto6", ["coords"] = vector3(36.03, 6549.18, 31.43),}, - [69] = { ["label"] = "Paleto6", ["coords"] = vector3(406.08, 6526.43, 27.75),}, - [70] = { ["label"] = "Paleto7", ["coords"] = vector3(1522.39, 6329.23, 24.61),}, - [71] = { ["label"] = "Paleto8", ["coords"] = vector3(1741.39, 6419.62, 35.04),}, - [72] = { ["label"] = "Lighthouse", ["coords"] = vector3(3426.72, 5174.42, 7.4),}, - [73] = { ["label"] = "EastSandy", ["coords"] = vector3(2525.99, 2586.62, 38.94),}, - [74] = { ["label"] = "Power Station", ["coords"] = vector3(2696.29, 1664.44, 24.52),}, - [75] = { ["label"] = "Stripclub", ["coords"] = vector3(106.24, -1280.32, 29.24),}, - [76] = { ["label"] = "Vinewood Video", ["coords"] = vector3(223.98, 121.53, 102.76),}, - [77] = { ["label"] = "Taxi", ["coords"] = vector3(882.67, -160.26, 77.11),}, - [78] = { ["label"] = "Resort", ["coords"] = vector3(-1245.63, 376.21, 75.34),}, - [79] = { ["label"] = "Bahama Mamas", ["coords"] = vector3(-1383.1, -639.99, 28.67),}, - } +-- Delivery locations and items is now in server/deliveries.lua +-- cornerselling pricing and rep is now in server/cornerselling.lua QBConfig.NoSellZones = { {loc = vector3(445.11, -991.3, 30.69), width = 10.0, length = 10.0, height = 10.0, rot = 180.0}, From 5b6fef2d490dfa7294cb5e777f6af48b0e749666 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sun, 24 Nov 2024 01:25:09 -0800 Subject: [PATCH 19/36] refractored a lot removed travellingmerchant file, now in pedspawns.lua --- client/animationsandfunctions.lua | 40 +++++--------------- client/deliveries.lua | 1 + client/functions.lua | 32 ++++++++++------ client/heroin.lua | 1 - client/lean.lua | 4 +- client/lsd.lua | 1 - client/meth.lua | 5 +-- client/oxyruns.lua | 34 +++++++---------- client/pedspawns.lua | 5 ++- client/shrooms.lua | 1 - client/travellingmerchant.lua | 14 ------- client/weed.lua | 45 ++++++++-------------- client/wholesale.lua | 63 +++++++++++++------------------ server/cocaine.lua | 17 +++++---- server/crack.lua | 6 ++- server/functions.lua | 11 +----- server/weed.lua | 4 +- 17 files changed, 112 insertions(+), 172 deletions(-) delete mode 100644 client/travellingmerchant.lua diff --git a/client/animationsandfunctions.lua b/client/animationsandfunctions.lua index 3365d58..971b8ec 100644 --- a/client/animationsandfunctions.lua +++ b/client/animationsandfunctions.lua @@ -11,8 +11,6 @@ local started = nil SetPtfxAssetNextCall(dict) end - - function MethCooking() local animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker" lib.requestAnimDict(animDict, 500) @@ -162,8 +160,6 @@ 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) end - - function CutCoke() local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter" lib.requestAnimDict(animDict, 500) @@ -382,9 +378,9 @@ function SpawnCarPedChase() lib.requestModel(`pounder`, Config.RequestModelTime) lib.requestModel("ig_priest", Config.RequestModelTime) lib.requestModel(`cargobob3`, Config.RequestModelTime) - local leancar = CreateVehicle(`pounder`, start.x+3, start.y-2, start.z-1, 52.0, true, true) - local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, true, false) - local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, true, false) + local leancar = CreateVehicle(`pounder`, start.x+3, start.y-2, start.z-1, 52.0, false, false) + local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, false, false) + local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false) FreezeEntityPosition(pilot2, true) SetEntityInvincible(pilot2, true) SetEntityAsMissionEntity(leancar) @@ -416,7 +412,7 @@ function SpawnCarPedChase() Wait(1000) until #(GetEntityCoords(driver) - GetEntityCoords(pilot2)) < 25.0 Wait( 3 * 1000) - local heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, true,true) + local heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) Wait(1000) if DoesEntityExist(heli) then SetEntityInvincible(pilot2, false) @@ -426,7 +422,7 @@ function SpawnCarPedChase() SetPedIntoVehicle(pilot2, heli, -1) TaskHeliMission(pilot2, heli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0) else - heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, true,true) + heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) end end end @@ -446,9 +442,9 @@ else lib.requestModel(`journey`, Config.RequestModelTime) lib.requestModel("a_m_m_hillbilly_02", Config.RequestModelTime) lib.requestModel(`cargobob3`, Config.RequestModelTime) - local methcar = CreateVehicle(`journey`, start.x+3, start.y-2, start.z-1, 52.0, true, true) - local methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, true, false) - local methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, true, false) + local methcar = CreateVehicle(`journey`, start.x+3, start.y-2, start.z-1, 52.0, false, false) + local methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, false, false) + local methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false) FreezeEntityPosition(methpilot, true) SetEntityInvincible(methpilot, true) SetEntityAsMissionEntity(methcar) @@ -481,7 +477,7 @@ else Wait(1000) until #(GetEntityCoords(methdriver) - GetEntityCoords(methpilot)) < 25.0 Wait( 3 * 1000) - local methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, true,true) + local methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) Wait(1000) if DoesEntityExist(methheli) then SetEntityInvincible(methpilot, false) @@ -492,7 +488,7 @@ else SetPedIntoVehicle(methpilot, methheli, -1) TaskHeliMission(methpilot, methheli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0) else - methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, true,true) + methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) end end end @@ -520,19 +516,3 @@ function SetUpPeds() end end -RegisterCommand('DrugRep', function() - if not Config.TierSystem then return end - local rep = lib.callback.await('md-drugs:server:GetRep', false) - lib.registerContext({ - id = 'DrugRep', - title = 'Drug Reputation', - options = { - {icon = "fa-solid fa-face-flushed", title = 'Cocaine: '..rep.coke}, - {icon = "fa-solid fa-syringe", title = 'Heroin: '..rep.heroin}, - {icon = "fa-solid fa-vial", title = 'LSD: '..rep.lsd}, - {icon = "fa-solid fa-plug", title = 'Dealer: '..rep.dealerrep}, - {icon = "fa-solid fa-money-bill", title = 'Corner Selling: ' .. rep.cornerselling.rep, description = 'Rank: ' .. rep.cornerselling.label } - } - }) - lib.showContext('DrugRep') -end, false) \ No newline at end of file diff --git a/client/deliveries.lua b/client/deliveries.lua index 4ac5717..5c03cc2 100644 --- a/client/deliveries.lua +++ b/client/deliveries.lua @@ -1,6 +1,7 @@ local QBCore = exports['qb-core']:GetCoreObject() local isActive = false local dealer = {} + RegisterNetEvent('md-drugs:client:opendealermenu', function() local rep = GetRep() makeMenu('dealermenu', rep) diff --git a/client/functions.lua b/client/functions.lua index 252b5a1..9c2f25f 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -624,15 +624,6 @@ AddEventHandler('onResourceStart', function(resource) LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b') end end) -local active = false -RegisterNetEvent('md-drugs:client:minusTier', function(data) - if active then return end - if not data then return end - active = true - if not progressbar('Cutting This ' ..GetLabel(data.item) .. ' More', 4000, 'uncuff') then return end - TriggerServerEvent('md-drugs:server:AddMas', data) - active = false -end) CreateThread(function() TriggerEvent('heroin:init') @@ -642,7 +633,24 @@ CreateThread(function() TriggerEvent('weed:init') end) -lib.callback.register('md-drugs:client:uncuff', function() - if not progressbar('Uncuffing', 4000, 'uncuff') then return end +lib.callback.register('md-drugs:client:uncuff', function(data) + if not progressbar(data, 4000, 'uncuff') then return end return true -end) \ No newline at end of file +end) + +RegisterCommand('DrugRep', function() + if not Config.TierSystem then return end + local rep = lib.callback.await('md-drugs:server:GetRep', false) + lib.registerContext({ + id = 'DrugRep', + title = 'Drug Reputation', + options = { + {icon = "fa-solid fa-face-flushed", title = 'Cocaine: '..rep.coke}, + {icon = "fa-solid fa-syringe", title = 'Heroin: '..rep.heroin}, + {icon = "fa-solid fa-vial", title = 'LSD: '..rep.lsd}, + {icon = "fa-solid fa-plug", title = 'Dealer: '..rep.dealerrep}, + {icon = "fa-solid fa-money-bill", title = 'Corner Selling: ' .. rep.cornerselling.rep, description = 'Rank: ' .. rep.cornerselling.label } + } + }) + lib.showContext('DrugRep') +end, false) \ No newline at end of file diff --git a/client/heroin.lua b/client/heroin.lua index d474188..250f075 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -104,7 +104,6 @@ RegisterNetEvent("md-drugs:client:heatliquidheroin", function(data) 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 diff --git a/client/lean.lua b/client/lean.lua index edb337c..9444a9a 100644 --- a/client/lean.lua +++ b/client/lean.lua @@ -1,8 +1,8 @@ local QBCore = exports['qb-core']:GetCoreObject() RegisterNetEvent("md-drugs:client:getsyruplocationtobuy", function() -Notify(Lang.Lean.marked, "success") -SpawnCarPedChase() + Notify(Lang.Lean.marked, "success") + SpawnCarPedChase() end) RegisterNetEvent('md-drugs:client:leancraft', function() diff --git a/client/lsd.lua b/client/lsd.lua index 03fef3c..ae074fc 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -1,7 +1,6 @@ local QBCore = exports['qb-core']:GetCoreObject() local tableout = false - local function createLabKit(coord, head) local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false) SetEntityHeading(labkit, head) diff --git a/client/meth.lua b/client/meth.lua index e6eae09..a250fa0 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -3,6 +3,7 @@ local amonia = nil local tray = nil local heated = nil local active = nil + local function startcook() if not ItemCheck('empty_weed_bag') then return end if not ItemCheck('acetone') then return end @@ -123,6 +124,4 @@ end) RegisterNetEvent("md-drugs:client:stealace", function(data) if not progressbar('Stealing Acetone', 4000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:getace", data.data) -end) - - +end) \ No newline at end of file diff --git a/client/oxyruns.lua b/client/oxyruns.lua index 9714781..0e93c63 100644 --- a/client/oxyruns.lua +++ b/client/oxyruns.lua @@ -5,8 +5,9 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function() lib.requestModel("burrito3", Config.RequestModelTime) local paid = lib.callback.await('md-drugs:server:payfortruck', false) if not paid then return end - local loc = lib.callback.await('md-drugs:server:getLocs', false) - local oxycar = CreateVehicle("burrito3",loc.singleSpot.truckspawn.x, loc.singleSpot.truckspawn.y,loc.singleSpot.truckspawn.z, loc.singleSpot.truckspawn.w, true, false) + local loca = lib.callback.await('md-drugs:server:getLocs', false) + local loc = loca.singleSpot.truckspawn + local oxycar = CreateVehicle("burrito3",loc.x, loc.y,loc.z, loc.w, true, false) exports[Config.Fuel]:SetFuel(oxycar, 100.0) TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(oxycar)) Notify(Lang.oxy.truck, 'success') @@ -14,21 +15,18 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function() AddSingleModel(oxycar, { event = "md-drugs:client:getfromtrunk", icon = "fas fa-box-circle-check", label = Lang.targets.oxy.pack}, nil ) end) - - RegisterNetEvent("md-drugs:client:getoxylocationroute", function() local config = lib.callback.await('md-drugs:server:getLocs', false) - local CurrentLocation = config.oxylocations[math.random(#config.oxylocations)] - if CurrentLocation ~= nil then - SetNewWaypoint(CurrentLocation.x, CurrentLocation.y) + local loc = config.oxylocations[math.random(#config.oxylocations)] + if loc ~= nil then + SetNewWaypoint(loc.x, loc.y) local current = "g_m_y_famdnf_01" lib.requestModel(current, Config.RequestModelTime) - local oxybuyer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false) - Freeze(oxybuyer, true, CurrentLocation.w) + local oxybuyer = CreatePed(0, current,loc.x,loc.y,loc.z-1, loc.w, false, false) + Freeze(oxybuyer, true, loc.w) repeat Wait(1000) - until #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x,CurrentLocation.y,CurrentLocation.z)) < 5.0 - + until #(GetEntityCoords(PlayerPedId()) - vector3(loc.x,loc.y,loc.z)) < 5.0 PoliceCall(Config.PoliceAlertOxy) AddSingleModel(oxybuyer, { type = "client", label = Lang.targets.oxy.talk, icon = "fas fa-eye", action = function() @@ -50,21 +48,15 @@ end) RegisterNetEvent("md-drugs:client:getfromtrunk", function() if carryPackage then Notify(Lang.oxy.cantcarry, "error") - else + else local pos = GetEntityCoords(PlayerPedId(), true) - RequestAnimDict('anim@heists@box_carry@') - while (not HasAnimDictLoaded('anim@heists@box_carry@')) do - Wait(7) - end + lib.requestAnimDict('anim@heists@box_carry@') TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false) - RequestModel("hei_prop_drug_statue_box_big") - while not HasModelLoaded("hei_prop_drug_statue_box_big") do - Wait(0) - end + lib.RequestModel("hei_prop_drug_statue_box_big") local object = CreateObject("hei_prop_drug_statue_box_big", pos.x, pos.y, pos.z, true, true, true) AttachEntityToEntity(object, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 57005), 0.05, 0.1, -0.3, 300.0, 250.0, 20.0, true, true, false, true, 1, true) carryPackage = object - end + end end) diff --git a/client/pedspawns.lua b/client/pedspawns.lua index b1a40b8..a8f781c 100644 --- a/client/pedspawns.lua +++ b/client/pedspawns.lua @@ -1,6 +1,7 @@ local QBCore = exports['qb-core']:GetCoreObject() CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) + local num = lib.callback.await('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"} for k, v in pairs (model) do lib.requestModel(v, Config.RequestModelTime) @@ -10,15 +11,17 @@ CreateThread(function() local SyrupLocation = CreatePed(0, 's_m_m_doctor_01', config.singleSpot.SyrupVendor.x,config.singleSpot.SyrupVendor.y,config.singleSpot.SyrupVendor.z-1, config.singleSpot.SyrupVendor.w, false, false) local WeedGuy = CreatePed(0,'u_m_m_jesus_01',config.singleSpot.WeedSaleman.x,config.singleSpot.WeedSaleman.y,config.singleSpot.WeedSaleman.z-1, config.singleSpot.WeedSaleman.w, false, false) local methdealer = CreatePed(0, "g_m_y_famdnf_01", config.singleSpot.MethHeistStart.x, config.singleSpot.MethHeistStart.y, config.singleSpot.MethHeistStart.z - 1, false, false) + local travellingmerchant = CreatePed(0, "g_m_y_famdnf_01",num.x,num.y,num.z-1, num.w, false, false) Freeze(tabdealer, true,config.singleSpot.buylsdlabkit.w) Freeze(SyrupLocation, true, config.singleSpot.SyrupVendor.w) Freeze(heroinkitdealer, true, config.singleSpot.buyheroinlabkit.w) Freeze(WeedGuy, true, config.singleSpot.WeedSaleman.w) Freeze(methdealer, true, 220.0) + Freeze(travellingmerchant, true, num.w) AddSingleModel(tabdealer,{ type = "client", label = Lang.targets.lsd.buy, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buylabkit", distance = 2.0}, tabdealer ) AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil ) AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil ) AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fas fa-eye", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil) AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fas fa-eye", action = function() Notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil ) - + AddSingleModel(travellingmerchant, {label = Lang.targets.travel.travel, icon = "fas fa-eye", action = function() makeMenu('travellingMerchant') lib.showContext('travellingMerchant') end}, nil) end) \ No newline at end of file diff --git a/client/shrooms.lua b/client/shrooms.lua index 9c21a44..5f9ba24 100644 --- a/client/shrooms.lua +++ b/client/shrooms.lua @@ -9,7 +9,6 @@ local function LoadModels(hash) Wait(10) end if HasModelLoaded(hash) then return true end - end local function pick(loc) diff --git a/client/travellingmerchant.lua b/client/travellingmerchant.lua deleted file mode 100644 index 45f698f..0000000 --- a/client/travellingmerchant.lua +++ /dev/null @@ -1,14 +0,0 @@ -local QBCore = exports['qb-core']:GetCoreObject() - -CreateThread(function() - local current = "g_m_y_famdnf_01" - lib.requestModel(current, Config.RequestModelTime) - local num = lib.callback.await('md-drugs:server:GetMerchant', false) - local travellingmerchant = CreatePed(0, current,num.x,num.y,num.z-1, num.w, false, false) - Freeze(travellingmerchant, true, num.w) - AddSingleModel(travellingmerchant, { label = Lang.targets.travel.travel, icon = "fas fa-eye", - action = function() - makeMenu('travellingMerchant') - lib.showContext('travellingMerchant') - end}, nil) -end) diff --git a/client/weed.lua b/client/weed.lua index eb5a0a8..28732a4 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -10,6 +10,11 @@ local function hasJob() return true end end + local function pick(loc) + if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end + TriggerServerEvent("weed:pickupCane", loc) + end + RegisterNetEvent('weed:respawnCane', function(loc) local v = GlobalState.WeedPlant[loc] local hash = GetHashKey(v.model) @@ -17,10 +22,7 @@ RegisterNetEvent('weed:respawnCane', function(loc) if not WeedPlant[loc] then WeedPlant[loc] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true) Freeze(WeedPlant[loc],true, v.heading) - AddSingleModel(WeedPlant[loc], - {icon = "fas fa-hand",label = Lang.targets.weed.pick, - action = function()if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end TriggerServerEvent("weed:pickupCane", loc) end}, - loc) + AddSingleModel(WeedPlant[loc], {icon = "fas fa-hand",label = Lang.targets.weed.pick, action = function() pick(loc) end}, loc) end end) @@ -36,10 +38,7 @@ RegisterNetEvent("weed:init", function() if not v.taken then WeedPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true) Freeze(WeedPlant[k],true, v.heading) - AddSingleModel(WeedPlant[k], - {icon = "fas fa-hand",label = Lang.targets.weed.pick, - action = function()if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end TriggerServerEvent("weed:pickupCane", k) end}, - k) + AddSingleModel(WeedPlant[k], {icon = "fas fa-hand",label = Lang.targets.weed.pick, action = function() pick(k) end}, k) end end end) @@ -101,30 +100,27 @@ AddBoxZoneSingle('MakeButterCrafting', config.singleSpot.MakeButter, {label = La canInteract = function() if hasJob() then return true end end }) -AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, { + AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, { name = 'Oil', icon = "fas fa-sign-in-alt", label = Lang.targets.weed.oil, action = function() if not ItemCheckMulti({'butane', 'grindedweed'}) then return end if not minigame() then - local explosion = math.random(1,100) local loc = GetEntityCoords(PlayerPedId()) - if explosion <= 99 then - AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true, true) - exploded = true - Notify(Lang.Weed.stovehot, "error") - Wait(1000 * 30) - exploded = false - end + AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true, true) + exploded = true + Notify(Lang.Weed.stovehot, "error") + Wait(1000 * 30) + exploded = false return end if not progressbar(Lang.Weed.shat, 4000, 'uncuff') then return end - TriggerServerEvent("md-drugs:server:makeoil") + TriggerServerEvent("md-drugs:server:makeoil") end, canInteract = function() - if hasJob() and exploded == false then return true end + if hasJob() and exploded == false then return true end end, -} ) + }) local stove = CreateObject("prop_cooker_03",config.singleSpot.MakeButter.x, config.singleSpot.MakeButter.y, config.singleSpot.MakeButter.z-1, true, false) SetEntityHeading(stove, 270.00) FreezeEntityPosition(stove, true) @@ -145,15 +141,6 @@ CreateThread(function() RefreshInterior(BikerWeedFarm.interiorId) end) - -RegisterNetEvent("md-drugs:client:rollanim", function() -if not progressbar(Lang.Weed.roll, 4000, 'uncuff') then return end -end) - -RegisterNetEvent("md-drugs:client:grind", function() - if not progressbar("grinding", 4000, 'uncuff') then return end -end) - RegisterNetEvent("md-drugs:client:dodabs", function() if not progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end AlienEffect() diff --git a/client/wholesale.lua b/client/wholesale.lua index e338a79..2882206 100644 --- a/client/wholesale.lua +++ b/client/wholesale.lua @@ -1,58 +1,49 @@ local QBCore = exports['qb-core']:GetCoreObject() local miss = false - RegisterNetEvent("md-drugs:client:GetLocation", function(drug) - if not GetCops(Config.PoliceCount) then return end + if not GetCops(Config.PoliceCount) then return end if miss then Notify(Lang.Wholesale.al, 'error') else - local CurrentLocation = drug.location + local loc = drug.location local timer = 0 miss = true - SetNewWaypoint(CurrentLocation.x, CurrentLocation.y) + SetNewWaypoint(loc.x, loc.y) lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime) - local current = "g_m_y_famdnf_01" - local drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false) - FreezeEntityPosition(drugdealer, true) - SetEntityInvincible(drugdealer, true) - AddMultiModel(drugdealer, {{ - label = Lang.targets.Wholesale.talk, - icon = "fas fa-eye", - action = function() - local luck = math.random(1,100) - if luck <= Config.SuccessfulChance then - TriggerEvent("md-drugs:client:SuccessSale", drug) - else - TriggerEvent("md-drugs:client:SetUp", drug) - end - Wait(3000) - DeleteEntity(drugdealer) - miss = false - end - }},drugdealer ) + local current = "g_m_y_famdnf_01" + local drugdealer = CreatePed(0, current,loc.x,loc.y,loc.z-1, 90.0, false, false) + FreezeEntityPosition(drugdealer, true) + SetEntityInvincible(drugdealer, true) + AddMultiModel(drugdealer, {{ + label = Lang.targets.Wholesale.talk, + icon = "fas fa-eye", + action = function() + local luck = math.random(1,100) + if luck <= Config.SuccessfulChance then + if not progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end + TriggerServerEvent("md-drugs:server:SuccessSale", drug) + else + progressbar("YOU FUCKED NOW", 4000, 'uncuff') + SetUpPeds() + end + Wait(3000) + DeleteEntity(drugdealer) + miss = false + end + }},drugdealer ) repeat Wait(1000) timer = timer + 1 - until #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x, CurrentLocation.y, CurrentLocation.z) ) < 4.0 or timer == Config.WholesaleTimeout + 1 + until #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 or timer == Config.WholesaleTimeout + 1 PoliceCall(Config.AlertPoliceWholesale) - if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x, CurrentLocation.y, CurrentLocation.z) ) < 4.0 then + if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 then timer = 0 else - Notify('The Buyer Waited To Long') + Notify('The Buyer Waited To Long', 'error') DeleteEntity(drugdealer) end end end) -RegisterNetEvent("md-drugs:client:SuccessSale", function(drug) - if not progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end - TriggerServerEvent("md-drugs:server:SuccessSale", drug) -end) - -RegisterNetEvent("md-drugs:client:SetUp", function(drug) - progressbar("YOU FUCKED NOW", 4000, 'uncuff') - TriggerServerEvent("md-drugs:server:SetUp", drug) - SetUpPeds() -end) diff --git a/server/cocaine.lua b/server/cocaine.lua index 8069aec..5e313fd 100644 --- a/server/cocaine.lua +++ b/server/cocaine.lua @@ -52,15 +52,12 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num) local src = source if not checkLoc(src, 'MakePowder', num) then return end local tier = 'tier1' - local logMessage = ' Made Raw Coke' if Config.TierSystem then local coke = getRep(src, 'coke') if coke > Config.Tier1 and coke <= Config.Tier2 then tier = 'tier2' - logMessage = ' Made Raw Coke tier 2' elseif coke > Config.Tier2 then tier = 'tier3' - logMessage = ' Made Raw Coke tier 3' end end if not GetRecipe(src, 'cocaine', 'cokepowder', tier) then return end @@ -130,10 +127,14 @@ local cokecut = {loosecokestagetwo = 2, loosecokestagethree = 3} for k, v in pairs (cokecut) do QBCore.Functions.CreateUseableItem(k, function(source, item) local src = source - local Player = getPlayer(src) - if Player.Functions.GetItemByName(item.name) then - if not Itemcheck(src, 'bakingsoda', 1) then return end - TriggerClientEvent('md-drugs:client:minusTier', src, {type = 'coke', xt = 'bakingsoda', item = k, amount = v,recieve = 'loosecoke'}) - end + local Player = getPlayer(src) + if Player.Functions.GetItemByName(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') + if not check then return end + if RemoveItem(src, k, 1) then + AddItem(src, 'loosecoke', v) + end + end end) end \ No newline at end of file diff --git a/server/crack.lua b/server/crack.lua index e33d313..111d176 100644 --- a/server/crack.lua +++ b/server/crack.lua @@ -52,7 +52,11 @@ for k, v in pairs (cokecut) do local Player = getPlayer(src) if Player.Functions.GetItemByName(item.name) then if not Itemcheck(src, 'bakingsoda', 1) then return end - TriggerClientEvent('md-drugs:client:minusTier', src, {type = 'crack', xt = 'bakingsoda', item = k, amount = v,recieve = 'crackrock'}) + local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting Crack Rock Further') + if not check then return end + if RemoveItem(src, k, 1) then + AddItem(src, 'crackrock', v) + end end end) end diff --git a/server/functions.lua b/server/functions.lua index aa1ca60..ec2609b 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -348,13 +348,4 @@ CreateThread(function() print('^2 Your Version:' .. version .. ' | Current Version:' .. text .. '' ) end end, "GET", "", "") -end) - -RegisterServerEvent('md-drugs:server:AddMas', function(data) - local src = source - if not data then return end - if not Itemcheck(src, data.xt, 1) then return end - if not RemoveItem(src, data.item, 1) then return end - RemoveItem(src, data.xt, 1) - AddItem(src, data.recieve, data.amount) -end) +end) \ No newline at end of file diff --git a/server/weed.lua b/server/weed.lua index 9327ff1..a8d93a4 100644 --- a/server/weed.lua +++ b/server/weed.lua @@ -122,7 +122,7 @@ end) QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item) local src = source - local check = lib.callback.await('md-drugs:client:uncuff', src) + local check = lib.callback.await('md-drugs:client:uncuff', src, 'Grinding Weed') if not check then return end if RemoveItem(src, "drycannabis",1 ) then AddItem(src, "grindedweed", 1) @@ -134,7 +134,7 @@ end) QBCore.Functions.CreateUseableItem("mdwoods", function(source, item) local src = source local Player = getPlayer(src) - local check = lib.callback.await('md-drugs:client:uncuff', src) + local check = lib.callback.await('md-drugs:client:uncuff', src, 'Breaking Blunt Open') if not check then return end if RemoveItem(src, "mdwoods",1 ) then AddItem(src, "bluntwrap", 5) From c349563ef3aba4297fbea06d94c0adf50c34fb8e Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 25 Nov 2024 01:21:53 -0800 Subject: [PATCH 20/36] adjusted icons --- client/animationsandfunctions.lua | 2 +- client/functions.lua | 17 ++--- client/meth.lua | 8 +-- client/oxyruns.lua | 4 +- client/pedspawns.lua | 6 +- client/target.lua | 32 +++++----- client/weed.lua | 10 +-- client/xtc.lua | 2 +- fxmanifest.lua | 7 +- test.sql => mddrugs.sql | 38 +++++------ patchnotes.txt | 103 ------------------------------ server/functions.lua | 4 +- shared/config.lua | 6 +- shared/english.lua | 5 +- version.txt | 2 +- 15 files changed, 70 insertions(+), 176 deletions(-) rename test.sql => mddrugs.sql (97%) delete mode 100644 patchnotes.txt diff --git a/client/animationsandfunctions.lua b/client/animationsandfunctions.lua index 971b8ec..ef51f70 100644 --- a/client/animationsandfunctions.lua +++ b/client/animationsandfunctions.lua @@ -394,7 +394,7 @@ function SpawnCarPedChase() until #(GetEntityCoords(driver) - stoploc) < 20.0 or GetEntityHealth(driver) == 0 RemoveBlip(leancar) if GetEntityHealth(driver) == 0 then - AddSingleModel(leancar, { name = 'leancar', icon = 'fa-solid fa-car', label = 'Steal From Car', + AddSingleModel(leancar, { name = 'leancar', icon = 'fa-solid fa-car', label = Lang.targets.lean.st, action = function() hit = hit + 1 if not minigame() then return end diff --git a/client/functions.lua b/client/functions.lua index 9c2f25f..16fece9 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -374,7 +374,7 @@ function AddBoxZoneSingle(name, loc, data) type = data.type or nil, event = data.event or nil, action = data.action or nil, - icon = data.icon, + icon = data.icon or "fa-solid fa-eye", label = data.label, data = data.data, canInteract = data.canInteract, @@ -389,7 +389,7 @@ function AddBoxZoneSingle(name, loc, data) event = data.event or nil, onSelect = data.action or nil, distance = 2.5, - icon = data.icon, + icon = data.icon or "fa-solid fa-eye", label = data.label, data = data.data, canInteract = data.canInteract, @@ -426,7 +426,7 @@ function AddBoxZoneMulti(name, table, data) type = data.type or nil, event = data.event or nil, action = data.action or nil, - icon = data.icon, + icon = data.icon or "fa-solid fa-eye", label = data.label, data = k, canInteract = data.canInteract or function() @@ -441,7 +441,7 @@ function AddBoxZoneMulti(name, table, data) type = data.type or nil, event = data.event or nil, onSelect = data.action or nil, - icon = data.icon, + icon = data.icon or "fa-solid fa-eye", label = data.label, data = k, distance = 2.5, @@ -461,7 +461,7 @@ function AddBoxZoneMulti(name, table, data) event = data.event or nil, action = data.action or nil, distance = 2.5, - label = data.label, + 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 @@ -475,8 +475,9 @@ end function AddBoxZoneMultiOptions(name, loc, data) local options = {} for k, v in pairs (data) do + table.insert(options, { - icon = v.icon, label = v.label, event = v.event or nil, action = v.action or nil, + 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 @@ -494,7 +495,7 @@ end function AddSingleModel(model, data, num) if Config.Target == 'qb' then exports['qb-target']:AddTargetEntity(model, {options = { - {icon = data.icon, label = data.label, event = data.event or nil, action = data.action or nil, data = num } + {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 }) @@ -507,7 +508,7 @@ function AddMultiModel(model, data, num) local options = {} for k, v in pairs (data) do table.insert(options, { - icon = v.icon, label = v.label, event = v.event or nil, action = v.action or nil, + 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 diff --git a/client/meth.lua b/client/meth.lua index a250fa0..0eb7723 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -101,18 +101,18 @@ CreateThread(function() }, } AddBoxZoneMultiOptions("cookmeth",vector3(1005.72, -3200.33, -38.52), options ) - AddBoxZoneSingle('boxmeth', vector3(1012.15, -3194.04, -39.20), {name = 'boxmeth',icon = "fas fa-sign-in-alt",label = Lang.targets.meth.box,action = function() smash()end, + AddBoxZoneSingle('boxmeth', vector3(1012.15, -3194.04, -39.20), {name = 'boxmeth',icon = "fa-solid fa-weight-scale",label = Lang.targets.meth.box,action = function() smash()end, canInteract = function() if tray then return true end end}) - AddBoxZoneSingle('adjustdials',vector3(1007.89, -3201.17, -38.99),{ name = 'adjustdials', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.adjust, + AddBoxZoneSingle('adjustdials',vector3(1007.89, -3201.17, -38.99),{ name = 'adjustdials', icon = "fa-solid fa-temperature-three-quarters", label = Lang.targets.meth.adjust, distance = 5, action = function() dials() end, canInteract = function() if amonia and heated == nil then return true end end }) if Config.MethHeist == false then - AddBoxZoneMulti('methep', config.MethEph, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.eph, event = 'md-drugs:client:stealeph'}) - AddBoxZoneMulti('methace', config.Methace, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.ace, event = 'md-drugs:client:stealace'}) + AddBoxZoneMulti('methep', config.MethEph, {icon = "fa-solid fa-bucket", label = Lang.targets.meth.eph, event = 'md-drugs:client:stealeph'}) + AddBoxZoneMulti('methace', config.Methace, {icon = "fa-solid fa-bucket", label = Lang.targets.meth.ace, event = 'md-drugs:client:stealace'}) end end) diff --git a/client/oxyruns.lua b/client/oxyruns.lua index 0e93c63..d256f5c 100644 --- a/client/oxyruns.lua +++ b/client/oxyruns.lua @@ -12,7 +12,7 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function() TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(oxycar)) Notify(Lang.oxy.truck, 'success') TriggerEvent("md-drugs:client:getoxylocationroute") - AddSingleModel(oxycar, { event = "md-drugs:client:getfromtrunk", icon = "fas fa-box-circle-check", label = Lang.targets.oxy.pack}, nil ) + AddSingleModel(oxycar, { event = "md-drugs:client:getfromtrunk", icon = "fa-solid fa-box", label = Lang.targets.oxy.pack}, nil ) end) RegisterNetEvent("md-drugs:client:getoxylocationroute", function() @@ -28,7 +28,7 @@ RegisterNetEvent("md-drugs:client:getoxylocationroute", function() Wait(1000) until #(GetEntityCoords(PlayerPedId()) - vector3(loc.x,loc.y,loc.z)) < 5.0 PoliceCall(Config.PoliceAlertOxy) - AddSingleModel(oxybuyer, { type = "client", label = Lang.targets.oxy.talk, icon = "fas fa-eye", + AddSingleModel(oxybuyer, { type = "client", label = Lang.targets.oxy.talk, icon = "fa-solid fa-dollar-sign", action = function() if carryPackage then if not progressbar(Lang.oxy.hand, 4000, 'uncuff') then return end diff --git a/client/pedspawns.lua b/client/pedspawns.lua index a8f781c..2f22ce5 100644 --- a/client/pedspawns.lua +++ b/client/pedspawns.lua @@ -21,7 +21,7 @@ CreateThread(function() AddSingleModel(tabdealer,{ type = "client", label = Lang.targets.lsd.buy, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buylabkit", distance = 2.0}, tabdealer ) AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil ) AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil ) - AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fas fa-eye", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil) - AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fas fa-eye", action = function() Notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil ) - AddSingleModel(travellingmerchant, {label = Lang.targets.travel.travel, icon = "fas fa-eye", action = function() makeMenu('travellingMerchant') lib.showContext('travellingMerchant') end}, nil) + AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fa-solid fa-cannabis", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil) + AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fa-solid fa-circle-info", action = function() Notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil ) + AddSingleModel(travellingmerchant, {label = Lang.targets.travel.travel, icon = "fa-solid fa-cart-shopping", action = function() makeMenu('travellingMerchant') lib.showContext('travellingMerchant') end}, nil) end) \ No newline at end of file diff --git a/client/target.lua b/client/target.lua index e185b0f..25e6ef1 100644 --- a/client/target.lua +++ b/client/target.lua @@ -7,20 +7,20 @@ CreateThread(function() 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 = icon, label = Lang.targets.lsd.lys}) -- lsd - AddBoxZoneMulti('stealdiethylamide', config.diethylamide, {event = "md-drugs:client:getdiethylamide", icon = icon, label = Lang.targets.lsd.die}) -- lsd - AddBoxZoneMulti('gettabs', config.gettabs, {event = "md-drugs:client:buytabs", icon = icon, label = Lang.targets.lsd.buyt}) -- lsd - AddBoxZoneMulti('dryheroin', config.dryplant, {event = "md-drugs:client:dryplant", icon = icon, label = Lang.targets.heroin.dry}) -- heroin - AddBoxZoneMulti('cutheroin', config.cutheroinone, {event = "md-drugs:client:cutheroin", icon = icon, label = Lang.targets.heroin.cut}) -- heroin - AddBoxZoneMulti('fillneedle', config.fillneedle, {event = "md-drugs:client:fillneedle", icon = icon, label = Lang.targets.heroin.fill}) -- heroin - AddBoxZoneMulti('makecrack', config.makecrack, {event = "md-drugs:client:makecrackone", icon = icon, label = Lang.targets.crack.cook}) -- crack - AddBoxZoneMulti('bagcrack', config.bagcrack, {event = "md-drugs:client:bagcrack", icon = icon, label = Lang.targets.crack.bag}) -- crack - AddBoxZoneMulti('fillprescription', config.FillPrescription, {event = "md-drugs:client:fillprescription", icon = icon, label = Lang.targets.pha.fill}) -- pharma - AddBoxZoneSingle('payfortruck', config.singleSpot.Payfortruck, {event = "md-drugs:client:GetOxyCar", icon = icon, label = Lang.targets.oxy.pay}) -- oxy runs - AddBoxZoneSingle('drymescaline', config.singleSpot.DryOut, {event = "md-drugs:client:drymescaline", icon = icon, label = Lang.targets.mescaline.dry}) -- mescaline - AddBoxZoneMulti('stealisosafrole', config.isosafrole, {event = "md-drugs:client:stealisosafrole", icon = icon, label = Lang.targets.xtc.iso}) -- xtc - AddBoxZoneMulti('stealmdp2p', config.mdp2p, {event = "md-drugs:client:stealmdp2p", icon = icon, label = Lang.targets.xtc.mdp}) -- xtc - AddBoxZoneMulti('rawxtcloc', config.rawxtcloc, {event = "md-drugs:client:makingrawxtc", icon = icon, label = Lang.targets.xtc.raw}) -- xtc - AddBoxZoneSingle('buypress', config.singleSpot.buypress, {event = "md-drugs:client:buypress", icon = icon, label = Lang.targets.xtc.press}) -- xtc - AddBoxZoneMulti('stamp', config.stamp, {event = "md-drugs:client:stampwhite", icon = icon, label = Lang.targets.xtc.stamp}) -- xtc + 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) diff --git a/client/weed.lua b/client/weed.lua index 28732a4..fb994ae 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -74,7 +74,7 @@ CreateThread(function() Wait(math.random(1000,5000)) Notify(Lang.Weed.take, "success") AddSingleModel(weedplant, { - icon = "fas fa-sign-in-alt", + icon = "fa-solid fa-cannabis", label = Lang.targets.weed.dpick, action = function() DeleteEntity(weedplant) @@ -90,19 +90,19 @@ CreateThread(function() if hasJob() then return true end end }) -AddBoxZoneSingle('teleinweedout', config.singleSpot.weedTeleout, { name = 'teleout', icon = "fas fa-sign-in-alt", label = Lang.targets.coke.exit, distance = 2.0, action = function() SetEntityCoords(PlayerPedId(),config.singleSpot.weedTelein) end, +AddBoxZoneSingle('teleinweedout', config.singleSpot.weedTeleout, { name = 'teleout', icon = "fa-solid fa-door-closed", label = Lang.targets.coke.exit, distance = 2.0, action = function() SetEntityCoords(PlayerPedId(),config.singleSpot.weedTelein) end, canInteract = function() if hasJob() then return true end end }) -AddBoxZoneSingle('teleinweedin', config.singleSpot.weedTelein, { name = 'teleout', icon = "fas fa-sign-in-alt", label = Lang.targets.coke.enter, distance = 2.0, action = function() SetEntityCoords(PlayerPedId(),config.singleSpot.weedTeleout) end, +AddBoxZoneSingle('teleinweedin', config.singleSpot.weedTelein, { name = 'teleout', icon = "fa-solid fa-door-open", label = Lang.targets.coke.enter, distance = 2.0, action = function() SetEntityCoords(PlayerPedId(),config.singleSpot.weedTeleout) end, canInteract = function() if hasJob() then return true end end }) -AddBoxZoneSingle('MakeButterCrafting', config.singleSpot.MakeButter, {label = Lang.targets.weed.butt, action = function() lib.showContext('ButterCraft') end, icon = "fas fa-sign-in-alt", +AddBoxZoneSingle('MakeButterCrafting', config.singleSpot.MakeButter, {label = Lang.targets.weed.butt, action = function() lib.showContext('ButterCraft') end, icon = "fa-solid fa-cookie", canInteract = function() if hasJob() then return true end end }) AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, { name = 'Oil', - icon = "fas fa-sign-in-alt", + icon = "fa-solid fa-oil-can", label = Lang.targets.weed.oil, action = function() if not ItemCheckMulti({'butane', 'grindedweed'}) then return end diff --git a/client/xtc.lua b/client/xtc.lua index bb13a2f..6ad6c56 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -35,7 +35,7 @@ else PlaceObjectOnGroundProperly(press) Freeze(press, true, head) local options = { - { icon = "fas fa-eye", label = Lang.targets.xtc.make, distance = 2.0, action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end, + { icon = "fa-solid fa-tablets", label = Lang.targets.xtc.make, distance = 2.0, action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end, canInteract = function() if xtcpress then return true end end }, {icon = "fas fa-eye", label = Lang.targets.xtc.pick, action = function() TriggerEvent("md-drugs:client:GetPressBack", type, press) end, distance = 2.0, diff --git a/fxmanifest.lua b/fxmanifest.lua index 888b143..8fe7519 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -3,7 +3,7 @@ author "mustache_dom" description "drugs by mustache dom" fx_version "cerulean" game "gta5" -version '3.8.0' +version '3.9.0' client_scripts { 'client/**.lua', } @@ -11,20 +11,15 @@ client_scripts { server_scripts { 'server/**.lua', '@oxmysql/lib/MySQL.lua', - } shared_scripts { '@ox_lib/init.lua', 'shared/**.lua', - } - lua54 'yes' - -dependency 'bob74_ipl' files { 'stream/mushroom.ytyp', 'stream/mushroom.ydr' diff --git a/test.sql b/mddrugs.sql similarity index 97% rename from test.sql rename to mddrugs.sql index 4e801d6..abc220f 100644 --- a/test.sql +++ b/mddrugs.sql @@ -1,19 +1,19 @@ - -CREATE TABLE IF NOT EXISTS `deliveriesdealer` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `cid` varchar(50) NOT NULL, - `itemdata` varchar(50) NOT NULL, - `timestart` varchar(50) NOT NULL, - `timestop` varchar(50) DEFAULT NULL, - `maxtime` varchar(50) NOT NULL, - `location` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; - -CREATE TABLE IF NOT EXISTS `drugrep` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `cid` varchar(50) DEFAULT NULL, - `drugrep` varchar(255) DEFAULT NULL, - `name` varchar(50) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; + +CREATE TABLE IF NOT EXISTS `deliveriesdealer` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` varchar(50) NOT NULL, + `itemdata` varchar(50) NOT NULL, + `timestart` varchar(50) NOT NULL, + `timestop` varchar(50) DEFAULT NULL, + `maxtime` varchar(50) NOT NULL, + `location` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; + +CREATE TABLE IF NOT EXISTS `drugrep` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` varchar(50) DEFAULT NULL, + `drugrep` varchar(255) DEFAULT NULL, + `name` varchar(50) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; diff --git a/patchnotes.txt b/patchnotes.txt deleted file mode 100644 index 8b09baa..0000000 --- a/patchnotes.txt +++ /dev/null @@ -1,103 +0,0 @@ -Notes from 3.5.2 -> 3.5.3 - -added easier calls for GetCops - -added support for qs phone emails - -added option for minigames 'none' so its not required - - -3.5.3 - > 3.5.4 - -1) Removed Config.imagelink - too tired of people not changing that and then asking me why images wont load. - - should work for qb, ps, lj, ox, qs, core, origen. if you use another inventory go to line 147 of the functions.lua in the client folder - - make this adjustment - ``` - elseif GetResourceState('yourinventoryname') == 'started' then - return "nui:/yourinventoryname/folder1/folder2/".. QBCore.Shared.Items[img].image - ``` -2 )small bug fixes in meth.lua client side -3) small bug fixes in pharma.lua server side -4) bug allowing to see target for drying weed when waiting for the weed to dry patched - -3.5.4 - > 3.5.5 -Updated small tweaks to client and server functions.lua - - -3.5.5 - > 3.5.6 -updated mainly client/server functions.lua to include a check for if using scully emotes then use the export to cancel emote once done with progressbar, added support for a few other inventories and dispatch - -added new item box events for additem and removeitem functions in the server/functions.lua -I left the original itembox event in, if you dont use the old event it will just trigger to a blank event and the next event will trigger, its a duct tape backwards compat method - -3.5.6 - > 3.5.7 - -added a couple new functions to cut back on repeating natives needed ( Freeze() ) will now set an entitys heading, block temp events, freeze, and set invincible) -added better calls for GetImage and GetLabel for ox inventory -converted all callbacks to lib.callback to increase optimization -should be fully compatible with qbx without needing to make a couple edits now - -3.5.7 - > 3.5.8 -Added support for fivemerr logs -3.5.8 -> 3.5.9 -added command /cornersell **you only need to update server/cornserselling.lua** from previous update - -3.5.9 - > 3.7.0 - -im bad at numbers sue me kek - -a lot has been changed with this version -The main thing to update from 3.5.9 to 3.7.0 is a couple things in your config -SAVE YOUR SHARED FOLDER AND COPY AND PASTE IT TO YOUR DESKTOP SO YOU HAVE A SECOND COPY - -``` -Config.oxtarget: - no longer exists in new version. Change it to - -Config.Target = 'qb' -- qb or ox - -Config.minigametype: -changed a little bit. you need to add this table to make things work now - -Config.Minigames = { - ps = { amount = 2, speed = 8,}, - ox = { 'easy', 'easy'}, --easy medium or hard each one corresponds to how many skillchecks and the difficulty - blcirprog = { amount = 2, speed = 50}, -- speed = 1-100 - blprog = { amount = 1, speed = 50}, -- speed = 1-100 - blkeyspam = { amount = 1, difficulty = 50}, -- difficulty = 1-100 - blkeycircle = { amount = 1, difficulty = 50, keynumbers = 3}, - blnumberslide = { amount = 1, difficulty = 50, keynumbers = 3}, - blrapidlines = { amount = 1, difficulty = 50, numberofline = 3}, - blcircleshake = { amount = 1, difficulty = 50, stages = 3}, - glpath = { gridsize = 10, lives = 3, timelimit = 999999}, - glspot = {gridSize = 6, timeLimit = 999999, charSet = "alphabet", required = 10}, - glmath = {timeLimit = 300000}, - -} - -what does this do, adds 10 more minigames than before you can use. How to set it, change Config.minigametype to the key of that table like ps ox blcirprog - -``` - -Now thats the config changes so you dont need to reconfig everything as I do my best to not change much in the config and work around what has been done - -Whats been added -``` -i moved tier system to SQL as its better than using metadata -run the SQL and it will autopopulate your metadata for rep so people wont lose anything - -I added a new sql table for deliveries - -it not checks overall time for deliveries regardless if you crash or not. - -Added new server file called recipes.lua - -its what you imagine, about 80-90% of the recipes for md-drugs - -``` - -Is there bugs, probably. But im tired of beta testing it over and over so please report bugs to my discord where i can see them and patch them quickly. - - -3.7.0 -> 3.7.1 -slight bug fixes with ox items, meth targeting diff --git a/server/functions.lua b/server/functions.lua index ec2609b..ca1b95c 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -340,7 +340,9 @@ CreateThread(function() print('^1 ox_lib Is A Depndancy, Not An Optional ') end end) + CreateThread(function() + if not lib.checkDependency('md-drugs', '1.5.0') then print('You Suck') end local url = "https://raw.githubusercontent.com/Mustachedom/md-drugs/main/version.txt" local version = GetResourceMetadata('md-drugs', "version" ) PerformHttpRequest(url, function(err, text, headers) @@ -348,4 +350,4 @@ CreateThread(function() print('^2 Your Version:' .. version .. ' | Current Version:' .. text .. '' ) end end, "GET", "", "") -end) \ No newline at end of file +end) diff --git a/shared/config.lua b/shared/config.lua index 667cef0..ad587c6 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -1,14 +1,12 @@ Config = {} --Ignore. -Config.Target = 'ox' -- qb or ox Config.respawnTime = 150 -- Seconds 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.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total Config.RequestModelTime = 30000 -- if you need more time than this, uhhhh wow - Config.FancyCokeAnims = true -- if you want multi location this needs to be false -Config.PharmaJob = "ems" -- what TYPE role you need to be on to get the command + Config.Joblock = false -- if you want weed to be a job Config.weedjob = "" -- what the job name is Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline @@ -28,7 +26,7 @@ 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.Dispatch = 'ps' -- either 'ps', 'cd', 'core', 'aty' - +Config.Target = 'ox' -- qb or ox Config.Minigames = { ps_circle = {amount = 2, speed = 8,}, ps_maze = {timelimit = 15}, diff --git a/shared/english.lua b/shared/english.lua index e576893..fb6c6ed 100644 --- a/shared/english.lua +++ b/shared/english.lua @@ -35,7 +35,8 @@ Lang.targets = { vial = 'Make Vial', }, lean = { - git = 'Get Task' + git = 'Get Task', + st = 'Steal From Car' }, lsd = { buy = 'Buy LSD Lab Kit', @@ -289,4 +290,4 @@ Lang.xtc = { Lang.Wholesale = { al = 'Already Called Someone!' -} \ No newline at end of file +} diff --git a/version.txt b/version.txt index 6641052..ee9ddd3 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -3.8.0 +3.9.0 From c37b7777487695ba89700fc6b80cf2d0a7f1a8f6 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 25 Nov 2024 01:46:26 -0800 Subject: [PATCH 21/36] added ped walk away feature if you dont cornersell to them fast enough --- client/cornerselling.lua | 19 +++++++++++++++++-- server/cornerselling.lua | 4 ++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/client/cornerselling.lua b/client/cornerselling.lua index 9235d75..2b89fe2 100644 --- a/client/cornerselling.lua +++ b/client/cornerselling.lua @@ -8,10 +8,22 @@ local active = false local function reset(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) + 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 - sold = true active = false end @@ -59,10 +71,13 @@ function Cornersell() canInteract = function() if not targbusy then return true end end, }}, nil) + local timer = 45 repeat Wait(1000) - until sold + 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 end RegisterNetEvent('md-drugs:client:cornerselling', function() diff --git a/server/cornerselling.lua b/server/cornerselling.lua index 33424ab..ac8c2c3 100644 --- a/server/cornerselling.lua +++ b/server/cornerselling.lua @@ -159,7 +159,7 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price local src = source local Player = getPlayer(src) local isIn = false - for k, v in pairs (Drugs) do + for k, v in pairs (Drugs) do if item == k then isIn = true end @@ -176,7 +176,7 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price worth = price } Player.Functions.AddItem('markedbills', 1, false, info ) - elseif QBConfig.CustomDirtyMoney then + elseif QBConfig.CustomDirtyMoney == true then AddItem(src, QBConfig.CustomDirtyMoneyitem, price) else Player.Functions.AddMoney('cash', price) From 0b943d815458edda94502f2158174dcaf03786bc Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 25 Nov 2024 02:07:07 -0800 Subject: [PATCH 22/36] update readme --- readme.md | 72 +++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/readme.md b/readme.md index 430c563..2402d22 100644 --- a/readme.md +++ b/readme.md @@ -4,45 +4,41 @@
- Mustache Scripts Discord
+ Mustache Scripts Discord
-# Credits +## **Credits** -- I used [Samuel's development](https://fivem.samueldev.shop/) Christmas script global states and prop spawning (with permission obtained prior to release) in the development process. -- Shout out to [STACHY225](https://babiczind.tebex.io/category/2103836) for working out the meth network animations! -- Huge credit to [Bostra](https://discord.gg/5ncbwMNq) for sharing free scripts and providing sanity checks during moments of confusion. Those cute mushrooms? His creation! -- Special thanks to [Feisty]() for the stunning visuals. If it looks good, she probably had a hand in it. -- Special shoutout to [Beta Testers]()Your feedback has been invaluable! -- Big Credit to [Bostra](https://discord.gg/5ncbwMNq). if you have been around you may have seen him post some free scripts and help people, There was definetly times I dm'd him saying what the fuck am I doing and he helped keep me sane. He also made the cute mushrooms! -- [Jim's Tebex](https://jimathy666.tebex.io/) for putting out open source resources that I was able to break and fix and learn how to code -- [jixeltay](https://jixeltay.tebex.io/category/scripts) for putting out banger after banger. These people help the community learn so much more -- Our partner [1of1 Servers]( https://1of1servers.com/) and their [discord](https://discord.gg/1of1servers) for their amazing server hosting! absolutely top notch. -- Thanks to Kamaryn for this [install guide video](https://youtu.be/zvuYnUfrqaA?si=FGJuBO5krZMC14Nd) join their [discord](https://discord.gg/KPRmZqFS) for other videos updates. +- **[Samuel's Development](https://fivem.samueldev.shop/):** Used their Christmas script global states and prop spawning (with permission). +- **[STACHY225](https://babiczind.tebex.io/category/2103836):** Meth network animations. +- **[Bostra](https://discord.gg/5ncbwMNq):** Free scripts, sanity checks, and those cute mushrooms! +- **[Feisty]():** Stunning visuals that make everything look amazing. +- **Beta Testers:** Your invaluable feedback made this possible. +- **[Jim's Tebex](https://jimathy666.tebex.io/):** Open-source resources that helped refine coding skills. +- **[Jixeltay](https://jixeltay.tebex.io/category/scripts):** For creating scripts that teach and inspire the community. +- **[1of1 Servers](https://1of1servers.com/):** Top-notch hosting and support. Join their [Discord](https://discord.gg/1of1servers). +- **[Kamaryn](https://discord.gg/KPRmZqFS):** For the [installation guide video](https://youtu.be/zvuYnUfrqaA?si=FGJuBO5krZMC14Nd). -# Dependencies +## **Dependencies** -- [ox_lib](https://github.com/overextended/ox_lib/releases/tag/v3.12.0) - -- [qb-target](https://github.com/qbcore-framework/qb-target) **or** [ox_target](https://github.com/overextended/ox_target) - -- emote script that uses the animations event - - for example one of these - - [dpemotes](https://github.com/andristum/dpemotes) -- should use RP instead - - [rpemotes](https://github.com/alberttheprince/rpemotes-reborn) - - [scully_emotemenu](https://github.com/Scullyy/scully_emotemenu) - -- [read](https://letters.hookedonphonics.com/us/read-guaranteed-G14.html?vc=HPG1&pc=SHPGBR&tracking_id=102917836048989658da259e8c83e6&url_id=5586&oid=707&vid=1855&cid=4194&hid=14509&utm_source=1855&aff_id2={aff_id2}&utm_campaign=PracticePackHOS&utm_medium=S&utm_content=BrandDollarPacks&gc_id=184380999&h_ad_id=374941048206&src=O&qid=3&msvid=v2) - -- GAME BUILD 2944 OR LATER +- **[ox_lib](https://github.com/overextended/ox_lib/releases/tag/v3.12.0)** +- **[qb-target](https://github.com/qbcore-framework/qb-target)** or **[ox_target](https://github.com/overextended/ox_target)** +- **Emote Scripts (supports animations):** + - [dpemotes](https://github.com/andristum/dpemotes) + - [rpemotes](https://github.com/alberttheprince/rpemotes-reborn) + - [scully_emotemenu](https://github.com/Scullyy/scully_emotemenu) +- **[Read](https://letters.hookedonphonics.com/us/read-guaranteed-G14.html)** +- **Game Build 2944 or Later** -# Preview -### [Preview link](https://www.youtube.com/watch?v=I_x7_oz_SAU) +## **Preview** -# How to install like a fuckin boss +- **[Watch Preview](https://www.youtube.com/watch?v=I_x7_oz_SAU)** + + +## **How to install like a fuckin boss** ### STEP 1 @@ -187,12 +183,12 @@ # STEP 6 - Run SQL - -# OPTIONAL STEPS + +# **OPTIONAL STEPS** ## Fivemerr -This is NOT a requirement but something I personally use and believe in. +This is **NOT** a requirement but something I personally use and believe in. - to integrate with fivemerr make sure you have ```set fivemerrLogs "API_KEY"``` in your server.cfg @@ -201,11 +197,15 @@ This is NOT a requirement but something I personally use and believe in. - profit -Why integrate with Fivemerr? Its a great place to store logs as it doesnt rely on discord webhooks and its far easier to search through +Why Integrate with Fivemerr? -As well as a place to offload images and videos from fivem that doesnt rely on discord since discord API will be automatically deleting images and videos after a certain amount of time If you need an invite to their server look below -- [Fivemerr Discord](https://discord.com/invite/fivemerr) -- [Fivemerr Docs](https://docs.fivemerr.com/) +- Efficient Logging: Unlike Discord webhooks, Fivemerr provides an organized and searchable log system. +- Media Storage: Easily store and access images or videos without relying on Discord. Discord's API often deletes media after a certain time, but Fivemerr keeps them secure and accessible. +- As well as a place to offload images and videos from fivem that doesnt rely on discord since discord API will be automatically deleting images and videos after a certain amount of time If you need an invite to their server look below + +[Fivemerr Discord](https://discord.com/invite/fivemerr) + +[Fivemerr Docs](https://docs.fivemerr.com/) ## Radial Menu - head to `qb-radial/config.lua` and search for the following event From 9d04b359c10c04496cbec7cbc0919b22b61a3cec Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 25 Nov 2024 12:27:43 -0800 Subject: [PATCH 23/36] vscode settings --- .vscode/settings.json | 26 +++++++++ client/animationsandfunctions.lua | 93 ++++++++++++++++--------------- client/functions.lua | 2 +- client/heroin.lua | 2 +- client/lsd.lua | 2 +- client/meth.lua | 4 +- client/weed.lua | 2 +- server/locations.lua | 4 +- 8 files changed, 81 insertions(+), 54 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5464e9e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,26 @@ +{ + "Lua.diagnostics.disable": [ + "missing-parameter", + "param-type-mismatch" + ], + "Lua.diagnostics.globals": [ + "lib", + "progressbar", + "loadParticle", + "makeMenu", + "minigame", + "tele", + "sorter", + "MySQL", + "trays", + "heroinkit", + "getPlayer", + "dist", + "sortTab", + "getRep", + "heroinCooldown", + "checkLoc", + "getRandW", + "shroomsCooldown" + ] +} \ No newline at end of file diff --git a/client/animationsandfunctions.lua b/client/animationsandfunctions.lua index ef51f70..b9aa20d 100644 --- a/client/animationsandfunctions.lua +++ b/client/animationsandfunctions.lua @@ -1,7 +1,8 @@ local QBCore = exports['qb-core']:GetCoreObject() local started = nil - function loadParticle(dict) + +local function loadParticle(dict) if not HasNamedPtfxAssetLoaded(dict) then RequestNamedPtfxAsset(dict) end @@ -21,9 +22,9 @@ function MethCooking() local scenePos, sceneRot = vector3(1010.656, -3198.445, -38.925), vector3(0.0, 0.0, 0.0) local netScene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3) NetworkAddPedToSynchronisedScene(PlayerPedId(), netScene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0) - local sacid = CreateObjectNoOffset(`bkr_prop_meth_sacid`, targetPosition, 1, 1, 0) + local sacid = CreateObjectNoOffset("bkr_prop_meth_sacid", targetPosition, 1, 1, 0) NetworkAddEntityToSynchronisedScene(sacid, netScene, animDict, "chemical_pour_short_sacid", 4.0, -8.0, 1) - local ammonia = CreateObjectNoOffset(`bkr_prop_meth_ammonia`, targetPosition, 1, 1, 0) + local ammonia = CreateObjectNoOffset("bkr_prop_meth_ammonia", targetPosition, 1, 1, 0) NetworkAddEntityToSynchronisedScene(ammonia, netScene, animDict, "chemical_pour_short_ammonia", 4.0, -8.0, 1) NetworkStartSynchronisedScene(netScene) Wait(animDuration) @@ -56,11 +57,11 @@ function SmashMeth() local netScene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3) NetworkAddPedToSynchronisedScene(ped, netScene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0) local objects, sceneObjects = {}, { - { hash = `w_me_hammer`, animName = "break_weigh_" .. ver .. "hammer"}, - { hash = `bkr_Prop_Meth_SmashedTray_01_frag_`, animName = "break_weigh_"..ver.."tray01"}, - { hash = `bkr_Prop_Meth_Tray_02a`, animName = "break_weigh_"..ver.."tray01^1"}, - { hash = `bkr_Prop_Meth_Tray_02a`, animName = "break_weigh_"..ver.."tray01^2"}, - { hash = `bkr_Prop_Meth_SmashedTray_01_frag_`, animName = "break_weigh_"..ver.."tray01^3"}, + { hash = "w_me_hammer", animName = "break_weigh_" .. ver .. "hammer"}, + { hash = "bkr_Prop_Meth_SmashedTray_01_frag_", animName = "break_weigh_"..ver.."tray01"}, + { hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^1"}, + { hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^2"}, + { hash = "bkr_Prop_Meth_SmashedTray_01_frag_", animName = "break_weigh_"..ver.."tray01^3"}, } for i=1, #sceneObjects, 1 do local obj = CreateObjectNoOffset(sceneObjects[i].hash, targetPosition, true, true, true) @@ -87,28 +88,28 @@ function BagMeth() local scenePos, sceneRot = vector3(1008.734, -3196.646, -39.99), vector3(0.0, 0.0, 1.08) local scenes = { { - { hash = `bkr_prop_meth_bigbag_04a`, animName = "break_weigh_"..ver.."box01"}, - { hash = `bkr_prop_meth_bigbag_03a`, animName = "break_weigh_"..ver.."box01^1"}, - { hash = `bkr_prop_meth_openbag_02`, animName = "break_weigh_"..ver.."methbag01"} + { hash = "bkr_prop_meth_bigbag_04a", animName = "break_weigh_"..ver.."box01"}, + { hash = "bkr_prop_meth_bigbag_03a", animName = "break_weigh_"..ver.."box01^1"}, + { hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01"} }, { - { hash = `bkr_prop_meth_openbag_02`, animName = "break_weigh_"..ver.."methbag01^1"}, - { hash = `bkr_prop_meth_openbag_02`, animName = "break_weigh_"..ver.."methbag01^2"}, - { hash = `bkr_prop_meth_openbag_02`, animName = "break_weigh_"..ver.."methbag01^3"} + { hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^1"}, + { hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^2"}, + { hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^3"} }, { - { hash = `bkr_prop_meth_openbag_02`, animName = "break_weigh_"..ver.."methbag01^4"}, - { hash = `bkr_prop_meth_openbag_02`, animName = "break_weigh_"..ver.."methbag01^5"}, - { hash = `bkr_prop_meth_openbag_02`, animName = "break_weigh_"..ver.."methbag01^6"} + { hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^4"}, + { hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^5"}, + { hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^6"} }, { - { hash = `bkr_prop_meth_scoop_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_meth_scoop_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"}, - { hash = `bkr_Prop_Meth_Tray_02a`, animName = "break_weigh_"..ver.."tray01^5"} + { hash = "bkr_prop_fakeid_clipboard_01a", animName = "break_weigh_"..ver.."clipboard"}, + { hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^5"} } } local scenesList, entitiesList = {}, {} @@ -169,9 +170,9 @@ function CutCoke() local scenePos, sceneRot = vector3(1090.37+.9, -3193.61-1.68, -39.60), vector3(0.0, 0.0, 0.00) 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"} + { 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 = {}, {} @@ -225,22 +226,22 @@ local ver = "" local scenePos, sceneRot = vector3(1090.62+4.3, -3196.2+3, -38.99-1), vector3(360.0, 360.0, 180.08) 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 = "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 = "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_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"}, + { hash = "bkr_prop_fakeid_clipboard_01a", animName = "break_weigh_"..ver.."clipboard"}, } } @@ -375,10 +376,10 @@ function SpawnCarPedChase() Notify(Lang.lean.act,'error') else started = true - lib.requestModel(`pounder`, Config.RequestModelTime) + lib.requestModel("pounder", Config.RequestModelTime) lib.requestModel("ig_priest", Config.RequestModelTime) - lib.requestModel(`cargobob3`, Config.RequestModelTime) - local leancar = CreateVehicle(`pounder`, start.x+3, start.y-2, start.z-1, 52.0, false, false) + lib.requestModel("cargobob3", Config.RequestModelTime) + local leancar = CreateVehicle("pounder", start.x+3, start.y-2, start.z-1, 52.0, false, false) local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, false, false) local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false) FreezeEntityPosition(pilot2, true) @@ -412,7 +413,7 @@ function SpawnCarPedChase() Wait(1000) until #(GetEntityCoords(driver) - GetEntityCoords(pilot2)) < 25.0 Wait( 3 * 1000) - local heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) + local heli = CreateVehicle("cargobob3", stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) Wait(1000) if DoesEntityExist(heli) then SetEntityInvincible(pilot2, false) @@ -422,7 +423,7 @@ function SpawnCarPedChase() SetPedIntoVehicle(pilot2, heli, -1) TaskHeliMission(pilot2, heli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0) else - heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) + heli = CreateVehicle("cargobob3", stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) end end end @@ -439,10 +440,10 @@ if startedmeth then Notify(Lang.meth.act,'error') else startedmeth = true - lib.requestModel(`journey`, Config.RequestModelTime) + lib.requestModel("journey", Config.RequestModelTime) lib.requestModel("a_m_m_hillbilly_02", Config.RequestModelTime) - lib.requestModel(`cargobob3`, Config.RequestModelTime) - local methcar = CreateVehicle(`journey`, start.x+3, start.y-2, start.z-1, 52.0, false, false) + lib.requestModel("cargobob3", Config.RequestModelTime) + local methcar = CreateVehicle("journey", start.x+3, start.y-2, start.z-1, 52.0, false, false) local methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, false, false) local methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false) FreezeEntityPosition(methpilot, true) @@ -464,7 +465,7 @@ else action = function() if not minigame() then return end TriggerServerEvent('md-drugs:server:givemethingridients') - startedmeth = nil + startedmeth = false if math.random(1,100) <= 30 then DeleteVehicle(methcar) DeleteEntity(methdriver) @@ -477,7 +478,7 @@ else Wait(1000) until #(GetEntityCoords(methdriver) - GetEntityCoords(methpilot)) < 25.0 Wait( 3 * 1000) - local methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) + local methheli = CreateVehicle("cargobob3", stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) Wait(1000) if DoesEntityExist(methheli) then SetEntityInvincible(methpilot, false) @@ -488,7 +489,7 @@ else SetPedIntoVehicle(methpilot, methheli, -1) TaskHeliMission(methpilot, methheli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0) else - methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) + methheli = CreateVehicle("cargobob3", stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) end end end diff --git a/client/functions.lua b/client/functions.lua index 16fece9..27dc9ca 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -207,7 +207,7 @@ end function GetLabel(label) if GetResourceState('ox_inventory') == 'started' then local Items = exports['ox_inventory']:Items() - if not Items[img] then print(' You Are Missing: ' .. img .. ' From Your ox items.lua') return end + if not Items[label] then print(' You Are Missing: ' .. label .. ' From Your ox items.lua') return end return Items[label]['label'] else if QBCore.Shared.Items[label] == nil then print("There Is No " .. label .. " In Your QB Items.lua") return end diff --git a/client/heroin.lua b/client/heroin.lua index 250f075..ee25cf8 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -95,7 +95,7 @@ RegisterNetEvent("md-drugs:client:heatliquidheroin", function(data) SetEntityHeading(dirtylabkitheroin, head) PlaceObjectOnGroundProperly(dirtylabkitheroin) loadParticle("core") - heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", dirtylabkitheroin, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false) + local heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", dirtylabkitheroin, 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) AddMultiModel(dirtylabkitheroin, {{event = "md-drugs:client:cleanheroinlabkit",icon = "fa-solid fa-hand-sparkles",label = Lang.targets.heroin.clean, data = dirtylabkitheroin}}, nil ) diff --git a/client/lsd.lua b/client/lsd.lua index ae074fc..df21000 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -60,7 +60,7 @@ RegisterNetEvent("md-drugs:client:heatliquid", function(data) local dirtylabkit = CreateObject("v_ret_ml_tablea", PedCoords.x, PedCoords.y, PedCoords.z-1, true, false) SetEntityHeading(dirtylabkit, head) loadParticle(dict) - exitPtfx = StartParticleFxLoopedOnEntity("scr_dst_cocaine", dirtylabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false) + local exitPtfx = StartParticleFxLoopedOnEntity("scr_dst_cocaine", dirtylabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false) PlaceObjectOnGroundProperly(dirtylabkit) SetParticleFxLoopedAlpha(exitPtfx, 3.0) Wait(100) diff --git a/client/meth.lua b/client/meth.lua index 0eb7723..b4237fc 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -21,7 +21,7 @@ end local function dials() if amonia == true then if not minigame() then - AddExplosion(1005.773, -3200.402, -38.524, 49, 10, true, false, true, true) + AddExplosion(1005.773, -3200.402, -38.524, 49, 10, true, false, true) ClearPedTasks(PlayerPedId()) amonia = nil active = nil @@ -37,7 +37,7 @@ local function smash() if tray then tray = false DeleteObject(trays) - local bucket = CreateObject(`bkr_prop_meth_bigbag_03a`, vector3(1012.85, -3194.29, -39.2), true, true, true) + local bucket = CreateObject("bkr_prop_meth_bigbag_03a", vector3(1012.85, -3194.29, -39.2), true, true, true) Freeze(bucket, true, 90.0) SmashMeth() Wait(100) diff --git a/client/weed.lua b/client/weed.lua index fb994ae..b7dc18d 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -108,7 +108,7 @@ canInteract = function() if hasJob() then return true end end if not ItemCheckMulti({'butane', 'grindedweed'}) then return end if not minigame() then local loc = GetEntityCoords(PlayerPedId()) - AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true, true) + AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true) exploded = true Notify(Lang.Weed.stovehot, "error") Wait(1000 * 30) diff --git a/server/locations.lua b/server/locations.lua index 198e33e..e21436a 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -115,8 +115,8 @@ function checkLoc(source, event, num) local ped = source local pos = GetPlayerPed(ped) local coord = GetEntityCoords(pos) - local loc = '' - if type(num) =='string' then + local loc + if type(num) == 'string' then loc = vector3(Target[event][num].x, Target[event][num].y, Target[event][num].z) else loc = Target[event][num].loc From cc33ecb7e29678e4307928acb854215e80e0938c Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:57:26 -0800 Subject: [PATCH 24/36] punctuation --- client/consumables.lua | 38 ++++++++++---------- client/crack.lua | 3 +- client/deliveries.lua | 4 +-- client/functions.lua | 2 -- client/lsd.lua | 1 - client/target.lua | 2 +- client/weed.lua | 12 +++---- client/wholesale.lua | 82 +++++++++++++++++++++--------------------- client/xtc.lua | 21 +++++------ server/heroin.lua | 8 ----- server/locations.lua | 2 ++ server/recipes.lua | 47 ++++++++++++------------ 12 files changed, 101 insertions(+), 121 deletions(-) diff --git a/client/consumables.lua b/client/consumables.lua index 8880f00..ad9fd81 100644 --- a/client/consumables.lua +++ b/client/consumables.lua @@ -23,23 +23,23 @@ RegisterNetEvent('md-drugs:client:consumedrugs', function(time, effect, anim, pr end) RegisterNetEvent('md-drugs:client:recievebuff', function(type, amount) -if type == 'speed' then - local count = 0 - SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.49) - repeat - count = count + 1 - Wait(1000) - until count == amount - SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.00) -end -if type == 'strength' then - local strength = 0 - SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true) - SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 50.0) - repeat - strength = strength + 1 - Wait(1000) - until strength == amount - SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.0) -end + if type == 'speed' then + local count = 0 + SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.49) + repeat + count = count + 1 + Wait(1000) + until count == amount + SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.00) + end + if type == 'strength' then + local strength = 0 + SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true) + SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 50.0) + repeat + strength = strength + 1 + Wait(1000) + until strength == amount + SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.0) + end end) diff --git a/client/crack.lua b/client/crack.lua index d7a9f14..4476308 100644 --- a/client/crack.lua +++ b/client/crack.lua @@ -11,5 +11,4 @@ RegisterNetEvent("md-drugs:client:bagcrack", function(data) if not ItemCheck('empty_weed_bag') then return end if not progressbar(Lang.Crack.bagcrack, 4000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:bagcrack", data.data) -end) - +end) \ No newline at end of file diff --git a/client/deliveries.lua b/client/deliveries.lua index 5c03cc2..b32ae7e 100644 --- a/client/deliveries.lua +++ b/client/deliveries.lua @@ -10,7 +10,7 @@ end) local function SpawnDealer() local getDealers = lib.callback.await('md-drugs:server:getDealers', false) - for k,v in pairs(getDealers) do + for k,v in pairs(getDealers) do local Ped = "g_m_y_famdnf_01" lib.requestModel(Ped, Config.RequestModelTime) local loc = json.decode(v.coords) @@ -29,7 +29,7 @@ local function SpawnDealer() { icon = "fa-solid fa-store", label = string.format(Lang.targets.Delivery.open, v.name), action = function() TriggerEvent('md-drugs:client:opendealermenu') end, }}, dealer[k]) - end + end end RegisterNetEvent('md-drugs:client:RefreshDealers', function() diff --git a/client/functions.lua b/client/functions.lua index 27dc9ca..671d4dd 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -475,7 +475,6 @@ 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, @@ -616,7 +615,6 @@ RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() Wait(3000) LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b') local check = lib.callback.await('md-drugs:server:GetRep', false) - return end) diff --git a/client/lsd.lua b/client/lsd.lua index df21000..998d319 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -100,7 +100,6 @@ RegisterNetEvent("md-drugs:client:buytabs", function(data) TriggerServerEvent("md-drugs:server:gettabpaper", data.data) end) - RegisterNetEvent("md-drugs:client:buylabkit", function() if QBCore.Functions.HasItem('lsdlabkit') then Notify(Lang.lsd.hav, 'error') return end if not progressbar(Lang.lsd.buykit, 4000, 'uncuff') then return end diff --git a/client/target.lua b/client/target.lua index 25e6ef1..a73bdb9 100644 --- a/client/target.lua +++ b/client/target.lua @@ -3,7 +3,7 @@ local icon = "fa solid fa-eye" CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) - if not config then return end + 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 diff --git a/client/weed.lua b/client/weed.lua index b7dc18d..a4f0f88 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -100,7 +100,7 @@ AddBoxZoneSingle('MakeButterCrafting', config.singleSpot.MakeButter, {label = La canInteract = function() if hasJob() then return true end end }) - AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, { +AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, { name = 'Oil', icon = "fa-solid fa-oil-can", label = Lang.targets.weed.oil, @@ -142,8 +142,8 @@ CreateThread(function() end) RegisterNetEvent("md-drugs:client:dodabs", function() -if not progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end -AlienEffect() + if not progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end + AlienEffect() end) local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName) @@ -169,11 +169,7 @@ local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tab } end sorter(options, 'title') - lib.registerContext({ - id = contextId, - title = contextTitle, - options = options - }) + lib.registerContext({ id = contextId, title = contextTitle, options = options}) end CreateThread(function() diff --git a/client/wholesale.lua b/client/wholesale.lua index 2882206..faef517 100644 --- a/client/wholesale.lua +++ b/client/wholesale.lua @@ -2,48 +2,48 @@ local QBCore = exports['qb-core']:GetCoreObject() local miss = false RegisterNetEvent("md-drugs:client:GetLocation", function(drug) - if not GetCops(Config.PoliceCount) then return end - if miss then - Notify(Lang.Wholesale.al, 'error') - else - local loc = drug.location - local timer = 0 - miss = true - SetNewWaypoint(loc.x, loc.y) - lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime) - local current = "g_m_y_famdnf_01" - local drugdealer = CreatePed(0, current,loc.x,loc.y,loc.z-1, 90.0, false, false) - FreezeEntityPosition(drugdealer, true) - SetEntityInvincible(drugdealer, true) - AddMultiModel(drugdealer, {{ - label = Lang.targets.Wholesale.talk, - icon = "fas fa-eye", - action = function() - local luck = math.random(1,100) - if luck <= Config.SuccessfulChance then - if not progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end - TriggerServerEvent("md-drugs:server:SuccessSale", drug) - else - progressbar("YOU FUCKED NOW", 4000, 'uncuff') - SetUpPeds() - end - Wait(3000) - DeleteEntity(drugdealer) - miss = false - end - }},drugdealer ) - repeat - Wait(1000) - timer = timer + 1 - until #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 or timer == Config.WholesaleTimeout + 1 - PoliceCall(Config.AlertPoliceWholesale) - if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 then - timer = 0 - else - Notify('The Buyer Waited To Long', 'error') - DeleteEntity(drugdealer) + if not GetCops(Config.PoliceCount) then return end + if miss then + Notify(Lang.Wholesale.al, 'error') + else + local loc = drug.location + local timer = 0 + miss = true + SetNewWaypoint(loc.x, loc.y) + lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime) + local current = "g_m_y_famdnf_01" + local drugdealer = CreatePed(0, current,loc.x,loc.y,loc.z-1, 90.0, false, false) + FreezeEntityPosition(drugdealer, true) + SetEntityInvincible(drugdealer, true) + AddMultiModel(drugdealer, {{ + label = Lang.targets.Wholesale.talk, + icon = "fas fa-eye", + action = function() + local luck = math.random(1,100) + if luck <= Config.SuccessfulChance then + if not progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end + TriggerServerEvent("md-drugs:server:SuccessSale", drug) + else + progressbar("YOU FUCKED NOW", 4000, 'uncuff') + SetUpPeds() + end + Wait(3000) + DeleteEntity(drugdealer) + miss = false + end + }},drugdealer ) + repeat + Wait(1000) + timer = timer + 1 + until #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 or timer == Config.WholesaleTimeout + 1 + PoliceCall(Config.AlertPoliceWholesale) + if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 then + timer = 0 + else + Notify('The Buyer Waited To Long', 'error') + DeleteEntity(drugdealer) + end end -end end) diff --git a/client/xtc.lua b/client/xtc.lua index 6ad6c56..1813cbe 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -27,13 +27,13 @@ lib.callback.register('md-drugs:client:setpress', function(type) if xtcpress then Notify(Lang.xtc.out, 'error') return false -else - local coords, head = StartRay2() - xtcpress = true - progressbar('Setting Press On The Ground', 4000, 'uncuff') - local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false) - PlaceObjectOnGroundProperly(press) - Freeze(press, true, head) + else + local coords, head = StartRay2() + xtcpress = true + progressbar('Setting Press On The Ground', 4000, 'uncuff') + local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false) + PlaceObjectOnGroundProperly(press) + Freeze(press, true, head) local options = { { icon = "fa-solid fa-tablets", label = Lang.targets.xtc.make, distance = 2.0, action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end, canInteract = function() if xtcpress then return true end end @@ -44,7 +44,7 @@ else } AddMultiModel(press, options, nil) return true, GetEntityCoords(press) -end + end end) RegisterNetEvent("md-drugs:client:XTCMenu", function(type) @@ -75,14 +75,12 @@ RegisterNetEvent("md-drugs:client:stealisosafrole", function(data) TriggerServerEvent("md-drugs:server:stealisosafrole",data.data) end) - RegisterNetEvent("md-drugs:client:stealmdp2p", function(data) if not minigame() then Notify(Lang.xtc.fail, "error") return end if not progressbar(Lang.xtc.mdp2p, 4000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:stealmdp2p", data.data) end) - RegisterNetEvent("md-drugs:client:makingrawxtc", function(data) if not ItemCheck('isosafrole') then return end if not ItemCheck('mdp2p') then return end @@ -96,8 +94,6 @@ RegisterNetEvent("md-drugs:client:MakeXTC", function(data) TriggerServerEvent("md-drugs:server:makextc",data) end) ------------------------------------------------------------------- Stamping - RegisterNetEvent("md-drugs:client:stampwhite", function(data) lib.registerContext({ id = 'stampxtc', title = 'Stamp XTC Menu', options = { @@ -134,7 +130,6 @@ RegisterNetEvent("md-drugs:client:stampwhite", function(data) lib.showContext('stampxtc') end) - RegisterNetEvent("md-drugs:client:getsinglepress", function() if not progressbar(Lang.xtc.buyp, 4000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:buypress") diff --git a/server/heroin.lua b/server/heroin.lua index af512b5..ee7cb79 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -26,7 +26,6 @@ Citizen.CreateThread(function() end end) - function heroinCooldown(loc) CreateThread(function() Wait(Config.respawnTime * 1000) @@ -48,7 +47,6 @@ local src = source end end) - RegisterServerEvent("heroin:pickupCane", function(loc) if not h[loc].taken then h[loc].taken = true @@ -77,7 +75,6 @@ RegisterServerEvent('md-drugs:server:dryplant', function(num) end end) - RegisterServerEvent('md-drugs:server:cutheroin', function(num) local src = source local Player = getPlayer(src) @@ -153,8 +150,6 @@ QBCore.Functions.CreateUseableItem('heroinlabkit', function(source, item) end end) - - RegisterServerEvent('md-drugs:server:heatliquidheroin', function() local src = source local Player = getPlayer(src) @@ -197,7 +192,6 @@ local cuth3 = Player.Functions.GetItemByName('heroincutstagethree') end end) - RegisterServerEvent('md-drugs:server:fillneedle', function(num) local src = source local Player = getPlayer(src) @@ -225,8 +219,6 @@ RegisterServerEvent('md-drugs:server:fillneedle', function(num) end end) - - RegisterServerEvent('md-drugs:server:failheroin', function() local src = source local Player = getPlayer(src) diff --git a/server/locations.lua b/server/locations.lua index e21436a..41afd14 100644 --- a/server/locations.lua +++ b/server/locations.lua @@ -131,10 +131,12 @@ function checkLoc(source, event, num) return false end end + local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)] lib.callback.register('md-drugs:server:getLocs', function() return Target end) + lib.callback.register('md-drugs:server:GetMerchant', function(source) return loc end) diff --git a/server/recipes.lua b/server/recipes.lua index 867b6ac..bf0fae3 100644 --- a/server/recipes.lua +++ b/server/recipes.lua @@ -140,31 +140,30 @@ function GetRecipe(source, 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 + 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 - return false + Notifys(src, ' You Need ' .. v .. ' Of ' .. GetLabels(k) .. ' To Do This', 'error') end - 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 + lib.callback.register('md-drugs:server:GetRecipe', function(source, type, cat) -if not source then return false end -return recipe[type][cat] + if not source then return false end + return recipe[type][cat] end) \ No newline at end of file From f9bc39fc1dfbb34b52bb635ada641f47d31a9bfe Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:03:49 -0800 Subject: [PATCH 25/36] version --- version.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/version.txt b/version.txt index ee9ddd3..b72ad01 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1 @@ -3.9.0 - +3.9.0 \ No newline at end of file From 65597810c744f4fd3b84f776faaaa7c1d7953da0 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:41:29 -0800 Subject: [PATCH 26/36] fix qs images --- client/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/functions.lua b/client/functions.lua index 671d4dd..4dae1d2 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -192,7 +192,7 @@ function GetImage(img) ['ps-inventory'] = "nui://ps-inventory/html/images/", ['lj-inventory'] = "nui://lj-inventory/html/images/", ['qb-inventory'] = "nui://qb-inventory/html/images/", - ['qs-inventory'] = "nui://qs-inventory/html/img/", + ['qs-inventory'] = "nui://qs-inventory/html/imgages/", ['origen_inventory'] = "nui://origen_inventory/html/img/", ['core_inventory'] = "nui://core_inventory/html/img/" } From 26fd63d750fb0675ff66f483ae36cc0d51ba99b2 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:45:17 -0800 Subject: [PATCH 27/36] edit --- client/cornerselling.lua | 2 ++ client/functions.lua | 6 ++++-- readme.md | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/cornerselling.lua b/client/cornerselling.lua index 2b89fe2..52b2efd 100644 --- a/client/cornerselling.lua +++ b/client/cornerselling.lua @@ -12,6 +12,7 @@ local function reset(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 @@ -60,6 +61,7 @@ function Cornersell() until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0 lib.requestAnimDict("rcmme_tracey1") TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false) FreezeEntityPosition(targ, true) + print(data.ped) 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, diff --git a/client/functions.lua b/client/functions.lua index 4dae1d2..e05349d 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -504,6 +504,7 @@ function AddSingleModel(model, data, num) end function AddMultiModel(model, data, num) + print(model) local options = {} for k, v in pairs (data) do table.insert(options, { @@ -516,7 +517,8 @@ function AddMultiModel(model, data, num) elseif Config.Target == 'ox' then exports.ox_target:addLocalEntity(model, options) elseif Config.Target == 'interact' then - exports.interact:AddLocalEntityInteraction({entity = model,offset = vec3(0.0, 0.0, 1.0),id = 'mddrugsmulti'..model,distance = 2.5,interactDst = 2.5, options = options}) + 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 @@ -569,7 +571,7 @@ end function StartRay2() local run = true local pedcoord = GetEntityCoords(PlayerPedId()) - lib.requestModel('v_ret_ml_tablea', 30000) + lib.requestModel('bkr_prop_coke_press_01aa', 30000) local table = CreateObject('bkr_prop_coke_press_01aa', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false) repeat local hit, entityHit, endCoords, surfaceNormal, matHash = lib.raycast.cam(511, 4, 10) diff --git a/readme.md b/readme.md index 2402d22..4f0d315 100644 --- a/readme.md +++ b/readme.md @@ -14,8 +14,6 @@ - **[Bostra](https://discord.gg/5ncbwMNq):** Free scripts, sanity checks, and those cute mushrooms! - **[Feisty]():** Stunning visuals that make everything look amazing. - **Beta Testers:** Your invaluable feedback made this possible. -- **[Jim's Tebex](https://jimathy666.tebex.io/):** Open-source resources that helped refine coding skills. -- **[Jixeltay](https://jixeltay.tebex.io/category/scripts):** For creating scripts that teach and inspire the community. - **[1of1 Servers](https://1of1servers.com/):** Top-notch hosting and support. Join their [Discord](https://discord.gg/1of1servers). - **[Kamaryn](https://discord.gg/KPRmZqFS):** For the [installation guide video](https://youtu.be/zvuYnUfrqaA?si=FGJuBO5krZMC14Nd). @@ -49,7 +47,7 @@ - delete `qb-drugs` ### STEP 3 -- all locations are in the server files now utilizing callbacks to build targets +- all locations, shops, pricings, and recipes are in the server files now utilizing callbacks to build targets and retrieve data - shops.lua - travelling merchant - Weed Store From fc5b1f51640a242f3871abfb4919c18ecfa4f112 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:07:15 -0800 Subject: [PATCH 28/36] yeehaw --- readme.md | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 4f0d315..68934fb 100644 --- a/readme.md +++ b/readme.md @@ -23,7 +23,7 @@ - **[ox_lib](https://github.com/overextended/ox_lib/releases/tag/v3.12.0)** - **[qb-target](https://github.com/qbcore-framework/qb-target)** or **[ox_target](https://github.com/overextended/ox_target)** - **Emote Scripts (supports animations):** - - [dpemotes](https://github.com/andristum/dpemotes) + - [dpemotes](https://github.com/andristum/dpemotes) <-- seriously just use rpemotes. this is old and outdated - [rpemotes](https://github.com/alberttheprince/rpemotes-reborn) - [scully_emotemenu](https://github.com/Scullyy/scully_emotemenu) - **[Read](https://letters.hookedonphonics.com/us/read-guaranteed-G14.html)** @@ -47,6 +47,7 @@ - delete `qb-drugs` ### STEP 3 + - all locations, shops, pricings, and recipes are in the server files now utilizing callbacks to build targets and retrieve data - shops.lua - travelling merchant @@ -79,11 +80,42 @@ - now the drug table is inserted into this file. - copy and paste your data inside of the ```lua - local Drugs = { - + local Drugs = { -- for example + ["weed_white-widow"] = {rep = 1,min = 15, max = 24 }, + ["weed_og-kush"] = {rep = 1,min = 15, max = 28 }, } ``` - all plant locations i.e. coke, heroin, weed, shrooms, mescaline are in the respective server files + - check server files to see drug specific settings now. + - heroin/lsd/ and xtc will have a setting table now at the top + ### HOW TO CONVERT FROM OLD + - its simple really + - copy the data from your Config and paste it in locations.lua + - if the previous config option was a single location ( Not designed for multiples) then check target.singleSpot + - shops.lua will now hold all shops for md-drugs so edit the data needed there + - this is simple but tedious, but will handle security better in the long run + - if you want to be lazy you can delete everything from + ```lua + local Targt = { + + } + ``` + **besides singleSpot** + + and copy and paste your + ```lua + Config.MakePowder = { + {loc = vector3(1086.20, -3195.30, -39.20), 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 = ""}, + } + and change the Config to Target like this BELOW the local Target = { + Target.MakePowder = { + {loc = vector3(1086.20, -3195.30, -39.20), 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 = ""}, + } + ``` ### STEP 4 - Head to your emote script search for **uncuff** if it's missing add it - if rpemotes do this From bf1471e2387fdcaed90f432103835cbc53673756 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:26:46 -0800 Subject: [PATCH 29/36] added codem dispatch support --- client/functions.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/functions.lua b/client/functions.lua index e05349d..2407a09 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -335,10 +335,19 @@ function PoliceCall(chance) exports["aty_dispatch"]:SendDispatch('Drug Sale', '420-69', 40, {'police'}) elseif dispatch == 'qs' then exports['qs-dispatch']:DrugSale() + elseif dispatch == 'codem' then + local Data = { + type = 'Drug Sale', + header = 'Someone Selling Drugs', + text = 'Hurry up and save the community', + code = '420-69', + } + exports['codem-dispatch']:CustomDispatch(Data) else print('Congrats, You Choose 0 of the options :)') end else + return end end From a07118d0cb2547c32804e71d1d4a0b0f9d9d4b71 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:50:05 -0800 Subject: [PATCH 30/36] added sv function to check cops and threw a cop check in wholesale, made it so you can only buy heroin table if none are in your inventory --- server/functions.lua | 11 +++++++++++ server/heroin.lua | 2 ++ server/wholesale.lua | 3 +++ shared/config.lua | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/server/functions.lua b/server/functions.lua index ca1b95c..a7e3a12 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -318,6 +318,17 @@ function sortTab(tbl, type) end) end +function getCops() + local amount = 0 + local players = QBCore.Functions.GetQBPlayers() + for k, v in pairs(players) do + if v.PlayerData.job.type == 'leo' and v.PlayerData.job.onduty then + amount = amount + 1 + end + end + return amount +end + lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args) local amount = 0 local players = QBCore.Functions.GetQBPlayers() diff --git a/server/heroin.lua b/server/heroin.lua index ee7cb79..c9ed9e1 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -102,6 +102,8 @@ RegisterServerEvent('md-drugs:server:getheroinlabkit', function() local src = source local Player = getPlayer(src) if not checkLoc(source, 'singleSpot', 'buyheroinlabkit') then return end + local has = Player.Functions.GetItemByName('heroinlabkit') + if has then Notifys(src, 'You Already Have A Heroin Lab Kit', 'error') return end if Player.Functions.RemoveMoney('cash', prices.heroinlabkitprice) then AddItem(src, 'heroinlabkit', 1) else diff --git a/server/wholesale.lua b/server/wholesale.lua index 4eda9f1..237a182 100644 --- a/server/wholesale.lua +++ b/server/wholesale.lua @@ -6,6 +6,7 @@ local heroin = {'heroin_ready', 'heroin_readystagetwo', 'heroin_readystagethree' local xtc = {"white_playboys", "white_playboys2", "white_playboys3", "white_playboys4", "blue_playboys", "blue_playboys2", "blue_playboys3", "blue_playboys4", "red_playboys", "red_playboys2", "red_playboys3", "red_playboys4", "orange_playboys", "orange_playboy2s", "orange_playboys3", "orange_playboys4", "white_aliens", "white_aliens2", "white_aliens3", "white_aliens4", "blue_aliens", "blue_aliens2", "blue_aliens3", "blue_aliens4", "red_aliens", "red_aliens3", "red_aliens2", "red_aliens4", "orange_aliens", "orange_aliens2", "orange_aliens3", "orange_aliens4", "white_pl", "white_pl2", "white_pl3", "white_pl4", "blue_pl", "blue_pl2", "blue_pl3", "blue_pl4", "red_pl", "red_pl2", "red_pl3", "red_pl4", "orange_pl", "orange_pl2", "orange_pl3", "orange_pl4", "white_trolls", "white_trolls2", "white_trolls3", "white_trolls4", "blue_trolls", "blue_trolls2", "blue_trolls3", "blue_trolls4", "red_trolls", "red_trolls2", "red_trolls3", "red_trolls4", "orange_trolls", "orange_trolls2", "orange_trolls3", "orange_trolls4", "white_cats2", "white_cats3", "white_cats4", "white_cats", "blue_cats", "blue_cats3", "blue_cats2", "blue_cats4", "red_cats", "red_cats2", "red_cats3", "red_cats4", "orange_cats", "orange_cats2", "orange_cats3", "orange_cats4" } local burners = {cokeburner = coke, crackburner = crack, lsdburner = lsd, heroinburner = heroin, xtcburner = xtc} local active = {} + local Price = { coke = {min = 20, max = 60}, crack = {min = 20, max = 60}, @@ -13,10 +14,12 @@ local Price = { heroin = {min = 20, max = 60}, xtc = {min = 20, max = 60}, } + for k, v in pairs (burners) do QBCore.Functions.CreateUseableItem(k, function(source, item) local src = source local Player = getPlayer(src) + if getCops() < Config.PoliceCount then return Notifys(src, 'Nobody Answered, Try Again Later', 'error') end for m, d in pairs (active) do if d.cid == Player.PlayerData.citizenid then return Notifys(src, 'You Already Have A Delivery To Make', 'error' ) diff --git a/shared/config.lua b/shared/config.lua index ad587c6..7a60c1c 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -14,7 +14,7 @@ Config.MethHeist = false Config.SuccessfulChance = 90 --- this is the chance of a Success wholesale 1-100 Config.AlertPoliceWholesale = 90 -- 1-100 of how often it will alert police Config.WholesaleTimeout = 600 -- time in seconds to get to the location -Config.PoliceCount = 0 -- Amount of police required +Config.PoliceCount = 2 -- Amount of police required Config.PoliceAlertOxy = 90 -- This is a % out of 100 to alert police ----------------------------------- TierSystem levels ** ONLY IN USE IF CONFIG.TIERSYTEM IS TRUE From 3043ecd924953582173c0bbe1d66dabdaf56ca08 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:26:48 -0800 Subject: [PATCH 31/36] removed core export: fixed bugs --- client/animationsandfunctions.lua | 2 -- client/cocaine.lua | 1 - client/consumables.lua | 2 -- client/cornerselling.lua | 1 - client/crack.lua | 2 -- client/deliveries.lua | 1 - client/functions.lua | 29 +++++++++++++++++++++++------ client/heroin.lua | 1 - client/lean.lua | 2 -- client/lsd.lua | 3 +-- client/mescaline.lua | 1 - client/meth.lua | 1 - client/oxyruns.lua | 3 +-- client/pedspawns.lua | 2 +- client/pharma.lua | 3 +-- client/shrooms.lua | 1 - client/target.lua | 2 -- client/weed.lua | 3 +-- client/wholesale.lua | 1 - client/xtc.lua | 1 - server/heroin.lua | 3 ++- server/weed.lua | 4 ++-- server/wholesale.lua | 4 ++-- shared/english.lua | 7 +++++-- 24 files changed, 39 insertions(+), 41 deletions(-) diff --git a/client/animationsandfunctions.lua b/client/animationsandfunctions.lua index b9aa20d..7a9425d 100644 --- a/client/animationsandfunctions.lua +++ b/client/animationsandfunctions.lua @@ -1,5 +1,3 @@ - -local QBCore = exports['qb-core']:GetCoreObject() local started = nil local function loadParticle(dict) diff --git a/client/cocaine.lua b/client/cocaine.lua index f61e0e6..1c3eca9 100644 --- a/client/cocaine.lua +++ b/client/cocaine.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local CocaPlant = {} local cuttingcoke = nil local baggingcoke = nil diff --git a/client/consumables.lua b/client/consumables.lua index ad9fd81..480a759 100644 --- a/client/consumables.lua +++ b/client/consumables.lua @@ -1,5 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() - RegisterNetEvent('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item) if not progressbar(progresstext .. GetLabel(item).. "!", time, anim ) then return end TriggerServerEvent('md-drugs:server:removeconsum', item) diff --git a/client/cornerselling.lua b/client/cornerselling.lua index 52b2efd..b3748bd 100644 --- a/client/cornerselling.lua +++ b/client/cornerselling.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local sell = false local sold = false local targbusy = false diff --git a/client/crack.lua b/client/crack.lua index 4476308..092f01e 100644 --- a/client/crack.lua +++ b/client/crack.lua @@ -1,5 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() - 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 diff --git a/client/deliveries.lua b/client/deliveries.lua index b32ae7e..c9372ba 100644 --- a/client/deliveries.lua +++ b/client/deliveries.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local isActive = false local dealer = {} diff --git a/client/functions.lua b/client/functions.lua index 2407a09..cc1d97d 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -258,12 +258,21 @@ end function ItemCheck(item) -if GetResourceState('ox_inventory') == 'started' then - if exports.ox_inventory:GetItemCount(item) >= 1 then return true else Notify('You Need ' .. GetLabel(item) .. " !", 'error') return false end -else - if QBCore.Shared.Items[item] == nil then print("There Is No " .. item .. " In Your QB Items.lua") return end - if QBCore.Functions.HasItem(item) then return true else Notify('You Need ' .. QBCore.Shared.Items[item].label .. " !", 'error') return false end + if GetResourceState('ox_inventory') == 'started' then + if exports.ox_inventory:GetItemCount(item) >= 1 then return true else Notify('You Need ' .. GetLabel(item) .. " !", 'error') return false end + else + if QBCore.Shared.Items[item] == nil then print("There Is No " .. item .. " In Your QB Items.lua") return end + if QBCore.Functions.HasItem(item) then return true else Notify('You Need ' .. QBCore.Shared.Items[item].label .. " !", 'error') return false end + end end + +function hasItem(item) + if GetResourceState('ox_inventory') == 'started' then + if exports.ox_inventory:GetItemCount(item) >= 1 then return true else return false end + else + if QBCore.Shared.Items[item] == nil then print("There Is No " .. item .. " In Your QB Items.lua") return end + if QBCore.Functions.HasItem(item) then return true else return false end + end end function ItemCheckMulti(item) @@ -663,4 +672,12 @@ RegisterCommand('DrugRep', function() } }) lib.showContext('DrugRep') -end, false) \ No newline at end of file +end, false) + +function getJobType() + return QBCore.Functions.GetPlayerData().job.type +end + +function getJobName() + return QBCore.Functions.GetPlayerData().job.name +end diff --git a/client/heroin.lua b/client/heroin.lua index ee25cf8..dae939d 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local PoppyPlants = {} local herointable = false diff --git a/client/lean.lua b/client/lean.lua index 9444a9a..9b9f903 100644 --- a/client/lean.lua +++ b/client/lean.lua @@ -1,5 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() - RegisterNetEvent("md-drugs:client:getsyruplocationtobuy", function() Notify(Lang.Lean.marked, "success") SpawnCarPedChase() diff --git a/client/lsd.lua b/client/lsd.lua index 998d319..a51a8bd 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local tableout = false local function createLabKit(coord, head) @@ -101,7 +100,7 @@ RegisterNetEvent("md-drugs:client:buytabs", function(data) end) RegisterNetEvent("md-drugs:client:buylabkit", function() - if QBCore.Functions.HasItem('lsdlabkit') then Notify(Lang.lsd.hav, 'error') return end + 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) diff --git a/client/mescaline.lua b/client/mescaline.lua index 12da5e8..faa6085 100644 --- a/client/mescaline.lua +++ b/client/mescaline.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local Mescaline = {} local function pick(loc) diff --git a/client/meth.lua b/client/meth.lua index b4237fc..4aeba44 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local amonia = nil local tray = nil local heated = nil diff --git a/client/oxyruns.lua b/client/oxyruns.lua index d256f5c..0bbaf35 100644 --- a/client/oxyruns.lua +++ b/client/oxyruns.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local carryPackage = nil RegisterNetEvent("md-drugs:client:GetOxyCar", function() @@ -9,7 +8,7 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function() local loc = loca.singleSpot.truckspawn local oxycar = CreateVehicle("burrito3",loc.x, loc.y,loc.z, loc.w, true, false) exports[Config.Fuel]:SetFuel(oxycar, 100.0) - TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(oxycar)) + TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(oxycar)) Notify(Lang.oxy.truck, 'success') TriggerEvent("md-drugs:client:getoxylocationroute") AddSingleModel(oxycar, { event = "md-drugs:client:getfromtrunk", icon = "fa-solid fa-box", label = Lang.targets.oxy.pack}, nil ) diff --git a/client/pedspawns.lua b/client/pedspawns.lua index 2f22ce5..0fd9675 100644 --- a/client/pedspawns.lua +++ b/client/pedspawns.lua @@ -1,4 +1,4 @@ -local QBCore = exports['qb-core']:GetCoreObject() + CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) local num = lib.callback.await('md-drugs:server:GetMerchant', false) diff --git a/client/pharma.lua b/client/pharma.lua index 1970137..3793d9d 100644 --- a/client/pharma.lua +++ b/client/pharma.lua @@ -1,7 +1,6 @@ -local QBCore = exports['qb-core']:GetCoreObject() lib.callback.register("md-drugs:client:prescriptionpad", function(data, op) - if not QBCore.Functions.GetPlayerData().job.type == 'ems' then return end + if getJobType() ~= 'ems' then return end local input = lib.inputDialog('Who To Give A Prescription To?',{ {type = 'select', label = 'Player Name', options = data}, {type = 'select', label = 'Prescription', options = op}}) diff --git a/client/shrooms.lua b/client/shrooms.lua index 5f9ba24..9ffd5b0 100644 --- a/client/shrooms.lua +++ b/client/shrooms.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local shrooms = {} local function LoadModels(hash) diff --git a/client/target.lua b/client/target.lua index a73bdb9..d046d46 100644 --- a/client/target.lua +++ b/client/target.lua @@ -1,5 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() -local icon = "fa solid fa-eye" CreateThread(function() local config = lib.callback.await('md-drugs:server:getLocs', false) diff --git a/client/weed.lua b/client/weed.lua index a4f0f88..4f93edb 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -1,10 +1,9 @@ -local QBCore = exports['qb-core']:GetCoreObject() local WeedPlant = {} local exploded, drying = false, false local function hasJob() if Config.Joblock then - if QBCore.Functions.GetPlayerData().job.name == Config.weedjob then + if getJobName() == Config.weedjob then return true else return false end else return true end diff --git a/client/wholesale.lua b/client/wholesale.lua index faef517..ebfbbc7 100644 --- a/client/wholesale.lua +++ b/client/wholesale.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local miss = false RegisterNetEvent("md-drugs:client:GetLocation", function(drug) diff --git a/client/xtc.lua b/client/xtc.lua index 1813cbe..2b2cb5f 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -1,4 +1,3 @@ -local QBCore = exports['qb-core']:GetCoreObject() local xtcpress = false RegisterNetEvent("md-drugs:client:setpress", function(type) diff --git a/server/heroin.lua b/server/heroin.lua index c9ed9e1..06f5696 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -48,6 +48,7 @@ local src = source end) RegisterServerEvent("heroin:pickupCane", function(loc) + if CheckDist(source, h[loc].location) then return end if not h[loc].taken then h[loc].taken = true GlobalState.PoppyPlants = h @@ -103,7 +104,7 @@ RegisterServerEvent('md-drugs:server:getheroinlabkit', function() local Player = getPlayer(src) if not checkLoc(source, 'singleSpot', 'buyheroinlabkit') then return end local has = Player.Functions.GetItemByName('heroinlabkit') - if has then Notifys(src, 'You Already Have A Heroin Lab Kit', 'error') return end + if has then Notifys(src, Lang.Heroin.haskit, 'error') return end if Player.Functions.RemoveMoney('cash', prices.heroinlabkitprice) then AddItem(src, 'heroinlabkit', 1) else diff --git a/server/weed.lua b/server/weed.lua index a8d93a4..675f1e7 100644 --- a/server/weed.lua +++ b/server/weed.lua @@ -54,13 +54,13 @@ function WeedCooldown(loc) end RegisterNetEvent("weed:pickupCane", function(loc) - local src = source + if CheckDist(source, weedPlant[loc].location) then return end if not weedPlant[loc].taken then weedPlant[loc].taken = true GlobalState.WeedPlant = weedPlant TriggerClientEvent("weed:removeCane", -1, loc) WeedCooldown(loc) - AddItem(src, 'wetcannabis', 1) + AddItem(source, 'wetcannabis', 1) Log(GetName(source) .. ' Picked Weed With a distance of ' .. dist(source, weedPlant[loc].location) .. ' vectors', 'weed') end end) diff --git a/server/wholesale.lua b/server/wholesale.lua index 237a182..f6bd0ee 100644 --- a/server/wholesale.lua +++ b/server/wholesale.lua @@ -19,10 +19,10 @@ for k, v in pairs (burners) do QBCore.Functions.CreateUseableItem(k, function(source, item) local src = source local Player = getPlayer(src) - if getCops() < Config.PoliceCount then return Notifys(src, 'Nobody Answered, Try Again Later', 'error') end + if getCops() < Config.PoliceCount then return Notifys(src, Lang.Wholesale.na, 'error') end for m, d in pairs (active) do if d.cid == Player.PlayerData.citizenid then - return Notifys(src, 'You Already Have A Delivery To Make', 'error' ) + return Notifys(src, Lang.Wholesale.al, 'error' ) end end local tab = '' diff --git a/shared/english.lua b/shared/english.lua index fb6c6ed..ffe3865 100644 --- a/shared/english.lua +++ b/shared/english.lua @@ -173,7 +173,8 @@ Lang.Heroin = { novial = "How Can You Make Heroin Vials Without Heroin Idiot", fail = 'You Over Heated Them Idiot', fill = 'Filled The Syringe', - nofill = 'How Are You Going To Fill Needles Of Heroin Without Heroin' + nofill = 'How Are You Going To Fill Needles Of Heroin Without Heroin', + haskit = 'You Already Have A Heroin Lab Kit' } Lang.Lean = { marked = ' Car Has Been Marked On Your Map', @@ -289,5 +290,7 @@ Lang.xtc = { } Lang.Wholesale = { - al = 'Already Called Someone!' + al = 'You Already Have A Delivery To Make', + na = 'No One Answered, Try Again Later', + } From b56e585691317efdeaf2dbaf065eddecfb87996b Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:26:08 -0800 Subject: [PATCH 32/36] added CUI function for createuseableitem. will add support for other frameworks in the future --- client/functions.lua | 25 ++++++++++++----------- fxmanifest.lua | 2 ++ server/cocaine.lua | 4 ++-- server/consumables.lua | 2 +- server/crack.lua | 4 ++-- server/functions.lua | 32 ++++++++++++----------------- server/heroin.lua | 2 +- server/lean.lua | 2 +- server/lsd.lua | 4 ++-- server/mescaline.lua | 2 +- server/pharma.lua | 4 ++-- server/shrooms.lua | 2 +- server/weed.lua | 46 ++++++++++++++++++++---------------------- server/wholesale.lua | 2 +- server/xtc.lua | 2 +- shared/config.lua | 2 +- 16 files changed, 66 insertions(+), 71 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index cc1d97d..fd2c9a2 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -5,6 +5,14 @@ local minigametype = Config.minigametype local notifytype = Config.Notify local dispatch = Config.Dispatch +function getJobType() + return QBCore.Functions.GetPlayerData().job.type +end + +function getJobName() + return QBCore.Functions.GetPlayerData().job.name +end + function progressbar(text, time, anim) TriggerEvent('animations:client:EmoteCommandStart', {anim}) if progressbartype == 'oxbar' then @@ -368,11 +376,11 @@ end function Freeze(entity, toggle, head) - SetEntityInvincible(entity, toggle) - SetEntityAsMissionEntity(entity, toggle, toggle) - FreezeEntityPosition(entity, toggle) - SetEntityHeading(entity, head) - SetBlockingOfNonTemporaryEvents(entity, toggle) + SetEntityInvincible(entity, toggle) + SetEntityAsMissionEntity(entity, toggle, toggle) + FreezeEntityPosition(entity, toggle) + SetEntityHeading(entity, head) + SetBlockingOfNonTemporaryEvents(entity, toggle) end function tele(coords) @@ -674,10 +682,3 @@ RegisterCommand('DrugRep', function() lib.showContext('DrugRep') end, false) -function getJobType() - return QBCore.Functions.GetPlayerData().job.type -end - -function getJobName() - return QBCore.Functions.GetPlayerData().job.name -end diff --git a/fxmanifest.lua b/fxmanifest.lua index 8fe7519..153a10e 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -9,11 +9,13 @@ client_scripts { } server_scripts { + 'server/functions.lua', 'server/**.lua', '@oxmysql/lib/MySQL.lua', } shared_scripts { + 'shared/config.lua', '@ox_lib/init.lua', 'shared/**.lua', } diff --git a/server/cocaine.lua b/server/cocaine.lua index 5e313fd..9363ace 100644 --- a/server/cocaine.lua +++ b/server/cocaine.lua @@ -125,14 +125,14 @@ end) local cokecut = {loosecokestagetwo = 2, loosecokestagethree = 3} for k, v in pairs (cokecut) do - QBCore.Functions.CreateUseableItem(k, function(source, item) + CUI(k, function(source, item) local src = source local Player = getPlayer(src) if Player.Functions.GetItemByName(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') if not check then return end - if RemoveItem(src, k, 1) then + if RemoveItem(src, k, 1) and RemoveItem(src, k, 1) then AddItem(src, 'loosecoke', v) end end diff --git a/server/consumables.lua b/server/consumables.lua index 1236bdf..ceca025 100644 --- a/server/consumables.lua +++ b/server/consumables.lua @@ -1,7 +1,7 @@ local QBCore = exports['qb-core']:GetCoreObject() for k, v in pairs(Consumables.Items) do - QBCore.Functions.CreateUseableItem(k, function(source, item) + CUI(k, function(source, item) if not Itemcheck(source, k, 1) then return end local time = v.time or Consumables.defaulttime local effect = v.effect or 0 diff --git a/server/crack.lua b/server/crack.lua index 111d176..5e3b3d7 100644 --- a/server/crack.lua +++ b/server/crack.lua @@ -47,14 +47,14 @@ end) local cokecut = {crackrockstagetwo = 2, crackrockstagethree = 3} for k, v in pairs (cokecut) do - QBCore.Functions.CreateUseableItem(k, function(source, item) + CUI(k, function(source, item) local src = source local Player = getPlayer(src) if Player.Functions.GetItemByName(item.name) then if not Itemcheck(src, 'bakingsoda', 1) then return end local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting Crack Rock Further') if not check then return end - if RemoveItem(src, k, 1) then + if RemoveItem(src, k, 1) and RemoveItem(src, 'bakingsoda', 1) then AddItem(src, 'crackrock', v) end end diff --git a/server/functions.lua b/server/functions.lua index a7e3a12..6c24abb 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -1,6 +1,6 @@ local QBCore = exports['qb-core']:GetCoreObject() local notify = Config.Notify -- qb or ox - +local inventory = Config.Inventory -- qb or ox ------------------------------------------ logging stuff local logs = false local logapi = GetConvar("fivemerrLogs", "") @@ -48,23 +48,13 @@ end ---------------------------------------------------- inventory catcher local invname = '' CreateThread(function() -if GetResourceState('ps-inventory') == 'started' then - invname = 'ps-inventory' -elseif GetResourceState('qb-inventory') == 'started' then - invname = 'qb-inventory' -else - invname = 'inventory' -end -end) - -local inventory = '' - -CreateThread(function() -if GetResourceState('ox_inventory') == 'started' then - inventory = 'ox' -else - inventory = 'qb' -end + if GetResourceState('ps-inventory') == 'started' then + invname = 'ps-inventory' + elseif GetResourceState('qb-inventory') == 'started' then + invname = 'qb-inventory' + else + invname = 'inventory' + end end) ------------------------------------ Player Stuff functions function getPlayer(source) @@ -114,7 +104,7 @@ function Notifys(source, text, type) TriggerClientEvent('okokNotify:Alert', src, '', text, 4000, type, false) else print"^1 Look At The Config For Proper Alert Options" - end + end end function GetLabels(item) @@ -126,6 +116,10 @@ function GetLabels(item) end end +function CUI(item, useFunction) + QBCore.Functions.CreateUseableItem(item, useFunction) +end + function Itemcheck(source, item, amount) if inventory == 'qb' then local Player = getPlayer(source) diff --git a/server/heroin.lua b/server/heroin.lua index 06f5696..9a4c25b 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -136,7 +136,7 @@ RegisterServerEvent('md-drugs:server:getheroinlabkitback', function() end) -QBCore.Functions.CreateUseableItem('heroinlabkit', function(source, item) +CUI('heroinlabkit', function(source, item) local src = source local Player = getPlayer(src) if not Itemcheck(source, 'heroinlabkit', 1) then return end diff --git a/server/lean.lua b/server/lean.lua index ff05933..ff39052 100644 --- a/server/lean.lua +++ b/server/lean.lua @@ -16,7 +16,7 @@ RegisterServerEvent('md-drugs:server:givelean', function() end end) -QBCore.Functions.CreateUseableItem('leancup', function(source, item) +CUI('leancup', function(source, item) if Itemcheck(source, 'leancup', 1) then TriggerClientEvent('md-drugs:client:leancraft', source) end diff --git a/server/lsd.lua b/server/lsd.lua index bdae097..eaded7a 100644 --- a/server/lsd.lua +++ b/server/lsd.lua @@ -20,7 +20,7 @@ RegisterServerEvent('md-drugs:server:getdiethylamide', function(num) end) -QBCore.Functions.CreateUseableItem('lsdlabkit', function(source, item) +CUI('lsdlabkit', function(source, item) local src = source local Player = getPlayer(src) local placed, loc = lib.callback.await('md-drugs:client:setlsdlabkit', src) @@ -195,7 +195,7 @@ local sheets = { } for k, v in pairs (sheets) do - QBCore.Functions.CreateUseableItem(v.item, function(source) + CUI(v.item, function(source) local src = source local Player = getPlayer(src) local math = math.random(1,10) diff --git a/server/mescaline.lua b/server/mescaline.lua index 07905f4..b14eb8e 100644 --- a/server/mescaline.lua +++ b/server/mescaline.lua @@ -54,7 +54,7 @@ RegisterNetEvent("md-drugs:server:drymescaline", function() if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end end) -QBCore.Functions.CreateUseableItem("driedmescaline", function(source, item) +CUI("driedmescaline", function(source, item) local src = source if RemoveItem(src, "driedmescaline", 1) then TriggerClientEvent("md-drugs:client:takemescaline", src) diff --git a/server/pharma.lua b/server/pharma.lua index 1f29033..62ea2d3 100644 --- a/server/pharma.lua +++ b/server/pharma.lua @@ -10,7 +10,7 @@ local function GetJob(source) end end -QBCore.Functions.CreateUseableItem('prescription_pad', function(source, item) +CUI('prescription_pad', function(source, item) local src = source local near = {} if GetJob(src) then @@ -38,7 +38,7 @@ end) local pharmabottle = {'vicodinbottle', 'adderalbottle','morphinebottle','xanaxbottle'} for m, d in pairs (pharmabottle) do -QBCore.Functions.CreateUseableItem(d, function(source, item) +CUI(d, function(source, item) local src = source local Player = getPlayer(src) local check = lib.callback.await("md-drugs:client:unbottle", src) diff --git a/server/shrooms.lua b/server/shrooms.lua index beadb11..f2d5404 100644 --- a/server/shrooms.lua +++ b/server/shrooms.lua @@ -50,7 +50,7 @@ RegisterNetEvent("shrooms:pickupCane", function(loc) end end) -QBCore.Functions.CreateUseableItem('shrooms', function(source, item) +CUI('shrooms', function(source, item) local src = source if TriggerClientEvent('md-drugs:client:takeshrooms', src, item.name) then RemoveItem(src, 'shrooms', 1) diff --git a/server/weed.lua b/server/weed.lua index 675f1e7..27f04a8 100644 --- a/server/weed.lua +++ b/server/weed.lua @@ -79,19 +79,13 @@ end) local bluntwrap = {'mdreddextro','mdlean'} for k, v in pairs (bluntwrap) do - QBCore.Functions.CreateUseableItem(v, function(source, item) - local src = source - TriggerClientEvent('md-drugs:client:makeBluntWrap', src) - end) + CUI(v, function(source, item) TriggerClientEvent('md-drugs:client:makeBluntWrap', source) end) end local bluntwraps = {'leanbluntwrap', 'dextrobluntwrap', 'bluntwrap'} for k, v in pairs (bluntwraps) do - QBCore.Functions.CreateUseableItem(v, function(source, item) - local src = source - TriggerClientEvent('md-drugs:client:rollBlunt', source) - end) + CUI(v, function(source, item) TriggerClientEvent('md-drugs:client:rollBlunt', source) end) end @@ -109,29 +103,33 @@ RegisterServerEvent('md-drugs:server:makeoil', function(data) if not GetRecipe(src, 'weed', 'oil', 'shatter') then return end end) -QBCore.Functions.CreateUseableItem("dabrig", function(source, item) -local src = source -local Player = getPlayer(src) -if Player.Functions.GetItemByName("butanetorch") then - if RemoveItem(src, "shatter", 1) then - TriggerClientEvent("md-drugs:client:dodabs", src) +CUI("dabrig", function(source, item) + local src = source + local Player = getPlayer(src) + + if Player.Functions.GetItemByName("butanetorch") then + if RemoveItem(src, "shatter", 1) then + TriggerClientEvent("md-drugs:client:dodabs", src) + end + else + Notifys(src, 'You Need A Butane Torch', 'error') end -end end) -QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item) - local src = source +CUI("weedgrinder", function(source, item) + local src = source + local Player = getPlayer(src) + local has = Player.Functions.GetItemByName("drycannabis") + 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') if not check then return end - if RemoveItem(src, "drycannabis",1 ) then - AddItem(src, "grindedweed", 1) - else - Notifys(src,'You Need Dried Weed', 'error') - end + if RemoveItem(src, "drycannabis",1 ) then + AddItem(src, "grindedweed", 1) + end end) -QBCore.Functions.CreateUseableItem("mdwoods", function(source, item) +CUI("mdwoods", function(source, item) local src = source local Player = getPlayer(src) local check = lib.callback.await('md-drugs:client:uncuff', src, 'Breaking Blunt Open') @@ -140,4 +138,4 @@ QBCore.Functions.CreateUseableItem("mdwoods", function(source, item) AddItem(src, "bluntwrap", 5) AddItem(src, "tobacco", 5) end -end) \ No newline at end of file +end) diff --git a/server/wholesale.lua b/server/wholesale.lua index f6bd0ee..c64bbb0 100644 --- a/server/wholesale.lua +++ b/server/wholesale.lua @@ -16,7 +16,7 @@ local Price = { } for k, v in pairs (burners) do - QBCore.Functions.CreateUseableItem(k, function(source, item) + CUI(k, function(source, item) local src = source local Player = getPlayer(src) if getCops() < Config.PoliceCount then return Notifys(src, Lang.Wholesale.na, 'error') end diff --git a/server/xtc.lua b/server/xtc.lua index a37c94c..19eb48e 100644 --- a/server/xtc.lua +++ b/server/xtc.lua @@ -24,7 +24,7 @@ local presses = { {item = 'quadpress', data = 'quad'}, } for k, v in pairs (presses) do -QBCore.Functions.CreateUseableItem(v.item, function(source, item) +CUI(v.item, function(source, item) local src = source local Player = getPlayer(src) local check, loc = lib.callback.await('md-drugs:client:setpress', src, v.data) diff --git a/shared/config.lua b/shared/config.lua index 7a60c1c..2448a44 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -6,7 +6,7 @@ Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, hero Config.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total Config.RequestModelTime = 30000 -- if you need more time than this, uhhhh wow Config.FancyCokeAnims = true -- if you want multi location this needs to be false - +Config.Inventory = 'qb' -- qb or ox, other if you dont use ox just mark as qb Config.Joblock = false -- if you want weed to be a job Config.weedjob = "" -- what the job name is Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline From 79569a18b6b90b85dfd79b29b665c933e46394d3 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 16 Dec 2024 03:22:44 -0800 Subject: [PATCH 33/36] fix for lean and meth missions update lsd heroin tables --- client/animationsandfunctions.lua | 41 +++++-------------------------- client/heroin.lua | 20 +++++++-------- client/lsd.lua | 41 ++++++++++++++----------------- server/heroin.lua | 16 ++++++------ 4 files changed, 42 insertions(+), 76 deletions(-) diff --git a/client/animationsandfunctions.lua b/client/animationsandfunctions.lua index 7a9425d..e03db4c 100644 --- a/client/animationsandfunctions.lua +++ b/client/animationsandfunctions.lua @@ -377,7 +377,7 @@ function SpawnCarPedChase() lib.requestModel("pounder", Config.RequestModelTime) lib.requestModel("ig_priest", Config.RequestModelTime) lib.requestModel("cargobob3", Config.RequestModelTime) - local leancar = CreateVehicle("pounder", start.x+3, start.y-2, start.z-1, 52.0, false, false) + local leancar = CreateVehicle("pounder", start.x+3, start.y-2, start.z-1, 52.0, true, false) local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, false, false) local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false) FreezeEntityPosition(pilot2, true) @@ -407,22 +407,7 @@ function SpawnCarPedChase() end end}, nil) else - repeat - Wait(1000) - until #(GetEntityCoords(driver) - GetEntityCoords(pilot2)) < 25.0 - Wait( 3 * 1000) - local heli = CreateVehicle("cargobob3", stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) - Wait(1000) - if DoesEntityExist(heli) then - SetEntityInvincible(pilot2, false) - DeleteVehicle(leancar) - DeleteEntity(driver) - SetEntityAsMissionEntity(heli) - SetPedIntoVehicle(pilot2, heli, -1) - TaskHeliMission(pilot2, heli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0) - else - heli = CreateVehicle("cargobob3", stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) - end + DeleteVehicle(leancar) DeleteEntity(driver) DeleteEntity(pilot2) end end end @@ -441,7 +426,7 @@ else lib.requestModel("journey", Config.RequestModelTime) lib.requestModel("a_m_m_hillbilly_02", Config.RequestModelTime) lib.requestModel("cargobob3", Config.RequestModelTime) - local methcar = CreateVehicle("journey", start.x+3, start.y-2, start.z-1, 52.0, false, false) + local methcar = CreateVehicle("journey", start.x+3, start.y-2, start.z-1, 52.0, true, false) local methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, false, false) local methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false) FreezeEntityPosition(methpilot, true) @@ -472,23 +457,9 @@ else end, }, nil ) else - repeat - Wait(1000) - until #(GetEntityCoords(methdriver) - GetEntityCoords(methpilot)) < 25.0 - Wait( 3 * 1000) - local methheli = CreateVehicle("cargobob3", stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) - Wait(1000) - if DoesEntityExist(methheli) then - SetEntityInvincible(methpilot, false) - CreatePickUpRopeForCargobob(methheli, 1) - AttachVehicleToCargobob(methheli, methcar, GetEntityBoneIndexByName(methcar, 'bodyshell'), 0.0, 0.0, 0.0) - DeleteEntity(methdriver) - SetEntityAsMissionEntity(methheli) - SetPedIntoVehicle(methpilot, methheli, -1) - TaskHeliMission(methpilot, methheli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0) - else - methheli = CreateVehicle("cargobob3", stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false) - end + DeleteVehicle(methcar) + DeleteEntity(methdriver) + DeleteEntity(methpilot) end end end diff --git a/client/heroin.lua b/client/heroin.lua index dae939d..1922e59 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -1,14 +1,15 @@ local PoppyPlants = {} local herointable = false +local dirty = false - local function createLabKit(coord, head) +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, { - { event = "md-drugs:client:heatliquidheroin", icon = "fa-solid fa-temperature-high", label = Lang.targets.heroin.cook, data = heroinlabkit}, - { event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.up, data = heroinlabkit, canInteract = function() if herointable then return true end end}}, - 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) end local function pickher(loc) @@ -88,16 +89,12 @@ 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") - DeleteObject(data.data) - local dirtylabkitheroin = CreateObject("v_ret_ml_tablea", loc.x, loc.y, loc.z-1, true, false) - SetEntityHeading(dirtylabkitheroin, head) - PlaceObjectOnGroundProperly(dirtylabkitheroin) loadParticle("core") - local heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", dirtylabkitheroin, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false) + 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) - AddMultiModel(dirtylabkitheroin, {{event = "md-drugs:client:cleanheroinlabkit",icon = "fa-solid fa-hand-sparkles",label = Lang.targets.heroin.clean, data = dirtylabkitheroin}}, nil ) return end if not progressbar(Lang.Heroin.success, 4000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:heatliquidheroin") @@ -106,7 +103,8 @@ 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 - TriggerServerEvent("md-drugs:server:removecleaningkitheroin", data.data) + local done = lib.callback.await('removeCleaningkit', false) + if done then dirty = false end end) RegisterNetEvent("md-drugs:client:deletedirtyheroin", function(data) diff --git a/client/lsd.lua b/client/lsd.lua index a51a8bd..b9a509e 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -1,14 +1,25 @@ local tableout = false - +local dirtylsd = false local function createLabKit(coord, head) local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false) SetEntityHeading(labkit, head) PlaceObjectOnGroundProperly(labkit) local options = { - { event = "md-drugs:client:heatliquid", icon = "fa-solid fa-temperature-high", label = Lang.targets.lsd.heat, data = labkit }, - { event = "md-drugs:client:refinequalityacid", icon = "fa-solid fa-temperature-high", label = Lang.targets.lsd.refine, data = labkit }, - { event = "md-drugs:client:maketabpaper", icon = "fa-regular fa-note-sticky", label = Lang.targets.lsd.dab, data = labkit }, - { event = "md-drugs:client:getlabkitback", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.back, data = labkit, canInteract = function() return tableout end } + { 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 }, + { 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 }, + { 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() + if not ItemCheck('cleaningkit') then return end + if not progressbar(Lang.lsd.clean, 4000, 'clean') then return end + local check = lib.callback.await('md-drugs:server:removecleaningkit') + if check then + dirtylsd = false + end + end, + canInteract = function() if dirtylsd then return true end end + } } AddMultiModel(labkit, options, labkit) end @@ -54,26 +65,10 @@ RegisterNetEvent("md-drugs:client:heatliquid", function(data) if not ItemCheck('lysergic_acid') then return end if not ItemCheck('diethylamide') then return end if not minigame() then - TriggerServerEvent("md-drugs:server:failheating") - DeleteObject(data.data) - local dirtylabkit = CreateObject("v_ret_ml_tablea", PedCoords.x, PedCoords.y, PedCoords.z-1, true, false) - SetEntityHeading(dirtylabkit, head) + dirtylsd = true loadParticle(dict) - local exitPtfx = StartParticleFxLoopedOnEntity("scr_dst_cocaine", dirtylabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false) - PlaceObjectOnGroundProperly(dirtylabkit) + 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) - AddSingleModel(dirtylabkit, {icon = "fa-solid fa-hand-sparkles", label = Lang.targets.lsd.clean, data = dirtylabkit, - action = function() - if not ItemCheck('cleaningkit') then return end - if not progressbar(Lang.lsd.clean, 4000, 'clean') then return end - local check = lib.callback.await('md-drugs:server:removecleaningkit') - if check then - DeleteObject(dirtylabkit) - createLabKit(PedCoords, head) - end - end - }, nil ) return end if not progressbar(Lang.lsd.heat, 7000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:heatliquid") diff --git a/server/heroin.lua b/server/heroin.lua index 9a4c25b..4f932bd 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -37,14 +37,15 @@ function heroinCooldown(loc) end) end -RegisterServerEvent('md-drugs:server:removecleaningkitheroin', function(data) -local src = source - if RemoveItem(src,"cleaningkit", 1) then - TriggerClientEvent("md-drugs:client:deletedirtyheroin", src, data) - Log(GetName(src) .. ' Wiped Down Their Heroin Lab Kit!' , 'heroin') - else - Notifys(src, "You cant clean it with spit alone", "error") +lib.callback.register('removeCleaningkit', function(source) + local Player = getPlayer(source) + for k, v in pairs(heroinLabKits) do + if v.ownerid == Player.PlayerData.citizenid then + RemoveItem(source, 'cleaningkit', 1) + return true + end end + return false end) RegisterServerEvent("heroin:pickupCane", function(loc) @@ -151,6 +152,7 @@ CUI('heroinlabkit', function(source, item) }) Notifys(src, Lang.Heroin.placed, "success") end + print(json.encode(heroinLabKits)) end) RegisterServerEvent('md-drugs:server:heatliquidheroin', function() From aca346cc1c7bcf0e9b54cc1961547a75d788d00b Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 16 Dec 2024 03:34:20 -0800 Subject: [PATCH 34/36] ps-ui fix --- client/cornerselling.lua | 1 - client/functions.lua | 5 ++++- client/pharma.lua | 1 + server/cocaine.lua | 2 +- server/heroin.lua | 2 -- server/wholesale.lua | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/client/cornerselling.lua b/client/cornerselling.lua index b3748bd..c9dc85b 100644 --- a/client/cornerselling.lua +++ b/client/cornerselling.lua @@ -60,7 +60,6 @@ function Cornersell() until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0 lib.requestAnimDict("rcmme_tracey1") TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false) FreezeEntityPosition(targ, true) - print(data.ped) 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, diff --git a/client/functions.lua b/client/functions.lua index fd2c9a2..c2dc04b 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -92,24 +92,28 @@ function minigame() exports['ps-ui']:Maze(function(success) check = success end, game['ps_maze'].timelimit) + repeat Wait(10) until check ~= nil return check elseif minigametype == 'ps_scrambler' then local check exports['ps-ui']:Scrambler(function(success) check = success end, game['ps_scrambler'].type, game['ps_scrambler'].time, game['ps_scrambler'].mirrored) + repeat Wait(10) until check ~= nil return check elseif minigametype == 'ps_var' then local check exports['ps-ui']:VarHack(function(success) check = success end, game['ps_var'].numBlocks, game['ps_var'].time) + repeat Wait(10) until check ~= nil return check elseif minigametype == 'ps_thermite' then local check exports['ps-ui']:Thermite(function(success) check = success end, game['ps_thermite'].time, game['ps_thermite'].gridsize, game['ps_thermite'].incorrect) + repeat Wait(10) until check ~= nil return check elseif minigametype == 'ox' then local success = lib.skillCheck(game['ox'], {'1', '2', '3', '4'}) @@ -530,7 +534,6 @@ function AddSingleModel(model, data, num) end function AddMultiModel(model, data, num) - print(model) local options = {} for k, v in pairs (data) do table.insert(options, { diff --git a/client/pharma.lua b/client/pharma.lua index 3793d9d..b3b225c 100644 --- a/client/pharma.lua +++ b/client/pharma.lua @@ -4,6 +4,7 @@ lib.callback.register("md-drugs:client:prescriptionpad", function(data, op) local input = lib.inputDialog('Who To Give A Prescription To?',{ {type = 'select', label = 'Player Name', options = data}, {type = 'select', label = 'Prescription', options = op}}) + if not input[1] then return end if not progressbar(Lang.Pharma.write, 4000, 'notepad') then return end return {who = input[1], what = input[2]} end) diff --git a/server/cocaine.lua b/server/cocaine.lua index 9363ace..e34859c 100644 --- a/server/cocaine.lua +++ b/server/cocaine.lua @@ -1,4 +1,4 @@ -local QBCore = exports['qb-core']:GetCoreObject() + local cokeplants = { { location = vector3(1474.25, -2643.87, 42.88), heading = 334.49, model = "prop_plant_01a" }, { location = vector3(1472.35, -2649.3, 41.87), heading = 329.56, model = "prop_plant_01a" }, diff --git a/server/heroin.lua b/server/heroin.lua index 4f932bd..fa2f620 100644 --- a/server/heroin.lua +++ b/server/heroin.lua @@ -152,7 +152,6 @@ CUI('heroinlabkit', function(source, item) }) Notifys(src, Lang.Heroin.placed, "success") end - print(json.encode(heroinLabKits)) end) RegisterServerEvent('md-drugs:server:heatliquidheroin', function() @@ -250,5 +249,4 @@ AddEventHandler('playerDropped', function() AddItem(src, 'heroinlabkit', 1) end end - json.encode(heroinLabKits) end) \ No newline at end of file diff --git a/server/wholesale.lua b/server/wholesale.lua index c64bbb0..12e6e0d 100644 --- a/server/wholesale.lua +++ b/server/wholesale.lua @@ -1,4 +1,4 @@ -local QBCore = exports['qb-core']:GetCoreObject() + local coke = { "cokebaggy", "cokebaggystagethree", "cokebaggystagetwo"} local crack = {"baggedcracked", "baggedcrackedstagetwo", "baggedcrackedstagethree"} local lsd = {'smiley_tabs', 'yinyang_tabs', 'wildcherry_tabs', 'pineapple_tabs', 'bart_tabs', 'gratefuldead_tabs'} From 9520c88d58c30603cd2715db8fca41a12a3920ff Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 16 Dec 2024 03:53:59 -0800 Subject: [PATCH 35/36] adjust consumables --- client/consumables.lua | 25 +++++- server/consumables.lua | 167 +++++++++++++++++++++++++++++++++++++---- server/functions.lua | 1 - server/xtc.lua | 2 +- shared/consumables.lua | 142 ----------------------------------- 5 files changed, 177 insertions(+), 160 deletions(-) diff --git a/client/consumables.lua b/client/consumables.lua index 480a759..62a16ee 100644 --- a/client/consumables.lua +++ b/client/consumables.lua @@ -1,6 +1,7 @@ -RegisterNetEvent('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item) + + +lib.callback.register('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item) if not progressbar(progresstext .. GetLabel(item).. "!", time, anim ) then return end - TriggerServerEvent('md-drugs:server:removeconsum', item) for k, v in pairs (status) do if k == 'health' then local cur = GetEntityHealth(PlayerPedId()) @@ -17,7 +18,9 @@ RegisterNetEvent('md-drugs:client:consumedrugs', function(time, effect, anim, pr TriggerEvent('md-drugs:client:recievebuff', k, v) end end - TriggerEvent('evidence:client:SetStatus', 'widepupils', 200) if effect == "alien" then AlienEffect() elseif effect == "ecstacy" then EcstasyEffect() elseif effect == "meth" then MethBagEffect() elseif effect == "coke" then CokeBaggyEffect() elseif effect == "trevor" then TrevorEffect() else end if status == nil then return end + TriggerEvent('evidence:client:SetStatus', 'widepupils', 200) + TriggerEvent('md-drugs:client:applyFeeling', effect) + return true end) RegisterNetEvent('md-drugs:client:recievebuff', function(type, amount) @@ -41,3 +44,19 @@ RegisterNetEvent('md-drugs:client:recievebuff', function(type, amount) SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.0) end end) + +RegisterNetEvent('md-drugs:client:applyFeeling', function(effect) + if effect == "alien" then + AlienEffect() + elseif effect == "ecstacy" then + EcstasyEffect() + elseif effect == "meth" then + MethBagEffect() + elseif effect == "coke" then + CokeBaggyEffect() + elseif effect == "trevor" then + TrevorEffect() + else + + end +end) \ No newline at end of file diff --git a/server/consumables.lua b/server/consumables.lua index ceca025..f05135d 100644 --- a/server/consumables.lua +++ b/server/consumables.lua @@ -1,6 +1,148 @@ local QBCore = exports['qb-core']:GetCoreObject() +--[[ + effect options + alien + ecstacy + meth + coke + trevor + none +]] -for k, v in pairs(Consumables.Items) do +--[[ +add = {} +health = number -- amount of health to give +stress = number -- number of stress to give +speed = number -- number of seconds you a fast boi +hunger = number -- number of hunger to fill +thirst = number -- same shit +strength = number -- how long you are strong boi + +]] +local Consume = { + -- meth +methbags = { time = 4000, effect = 'meth', anim = "smoke", progressbartext = "Injesting", + add = {health = -20, stress = -10, speed = 40, strength = 10, thirst = -30}}, +cokebaggy = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, +cokebaggystagetwo = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, +cokebaggystagethree = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, +-- heroin +heroin_ready = { anim = 'shootup', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +heroin_readystagetwo = { anim = 'shootup', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +heroin_readystagethree = { anim = 'shootup', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +-- crack +baggedcracked = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, +baggedcrackedstagetwo = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, +baggedcrackedstagethree = { anim = 'smell', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +-- xtc +white_playboys = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_playboys2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_playboys3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_playboys4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_playboys = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_playboys2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_playboys3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_playboys4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_playboys = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10, hunger = 10 }}, +red_playboys2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_playboys3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_playboys4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_playboys = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_playboy2s = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_playboys3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_playboys4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_aliens = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_aliens2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_aliens3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_aliens4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_aliens = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_aliens2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_aliens3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_aliens4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_aliens = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_aliens3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_aliens2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_aliens4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_aliens = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_aliens2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_aliens3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_aliens4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_pl = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_pl2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_pl3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_pl4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_pl = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_pl2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_pl3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_pl4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_pl = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_pl2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_pl3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_pl4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_pl = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_pl2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_pl3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_pl4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_trolls = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_trolls2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_trolls3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_trolls4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_trolls = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_trolls2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_trolls3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_trolls4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_trolls = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_trolls2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_trolls3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_trolls4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_trolls = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_trolls2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_trolls3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_trolls4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_cats2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_cats3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_cats4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +white_cats = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_cats = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_cats3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_cats2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +blue_cats4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_cats = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_cats2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_cats3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +red_cats4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_cats = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_cats2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_cats3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +orange_cats4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, +-- weed +specialbrownie = { anim = 'edible', effect = 'alien', add = { hunger = 10, stress = -10 }}, +specialcookie = { anim = 'edible', effect = 'alien', add = { hunger = 10, stress = -10 }}, +specialchocolate = { anim = 'edible', effect = 'alien', add = { hunger = 10, stress = -10 }}, +specialmuffin = { anim = 'edible', effect = 'alien', add = { hunger = 10, stress = -10 }}, +blunt = { anim = 'smokeweed', effect = 'alien', add = { stress = -10 }}, +dextroblunts = { anim = 'smokeweed', effect = 'alien', add = { stress = -10 }}, +leanblunts = { anim = 'smokeweed', effect = 'alien', add = { stress = -10 }}, +chewyblunt = { anim = 'smokeweed', effect = 'alien', add = { stress = -10 }}, +-- lean +cupofdextro = { anim = 'cup', effect = 'alien', add = { stress = -10 }}, +cupoflean = { anim = 'cup', effect = 'alien', add = { stress = -10 }}, +-- lsd +smiley_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, +wildcherry_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, +yinyang_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, +pineapple_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, +bart_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, +gratefuldead_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, + +-- pharma +vicodin = { anim = 'pill', effect = 'none', add = { health = 20 }}, +adderal = { anim = 'pill', effect = 'none', add = { stress = -20 }}, +morphine = { anim = 'pill', effect = 'none', add = { health = 40 }}, +xanax = { anim = 'pill', effect = 'none', add = { stress = -40 }}, +} + +for k, v in pairs(Consume) do CUI(k, function(source, item) if not Itemcheck(source, k, 1) then return end local time = v.time or Consumables.defaulttime @@ -8,25 +150,24 @@ for k, v in pairs(Consumables.Items) do local anim = v.anim or Consumables.defaultanim local progressbartext = v.progressbartext or Consumables.defaultprogresstext local add = v.add or {hunger = 0} - TriggerClientEvent("md-drugs:client:consumedrugs", source, time, effect, anim, progressbartext, add, k) + local done = lib.callback.await('md-drugs:client:consumedrugs', source, time, effect, anim, progressbartext, add, k) + if done then + RemoveItem(source, k, 1) + end end) end -RegisterNetEvent('md-drugs:server:removeconsum', function(item) - RemoveItem(source,item, 1) - Log(GetName(source) .. ' Got High With ' .. item .. '!', 'consuming') -end) - RegisterNetEvent('md-drugs:server:updatestatus', function(stat, statval) local Player = getPlayer(source) + local hunger, thirst = Player.PlayerData.metadata.hunger, Player.PlayerData.metadata.thirst if stat == "thirst" then - local value = Player.PlayerData.metadata.thirst + statval - Player.Functions.SetMetaData('hunger', value) - TriggerClientEvent('hud:client:UpdateNeeds', source, Player.PlayerData.metadata.hunger, value) - elseif stat == "hunger" then - local value = Player.PlayerData.metadata.hunger + statval + local value = thirst + statval Player.Functions.SetMetaData('thirst', value) - TriggerClientEvent('hud:client:UpdateNeeds', source, Player.PlayerData.metadata.thirst, value) + TriggerClientEvent('hud:client:UpdateNeeds', source, hunger, value) + elseif stat == "hunger" then + local value = hunger + statval + Player.Functions.SetMetaData('hunger', value) + TriggerClientEvent('hud:client:UpdateNeeds', source, value, thirst) elseif stat == "stress" then local value = Player.PlayerData.metadata.stress + statval Player.Functions.SetMetaData('stress', value) diff --git a/server/functions.lua b/server/functions.lua index 6c24abb..84a21f6 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -347,7 +347,6 @@ CreateThread(function() end) CreateThread(function() - if not lib.checkDependency('md-drugs', '1.5.0') then print('You Suck') end local url = "https://raw.githubusercontent.com/Mustachedom/md-drugs/main/version.txt" local version = GetResourceMetadata('md-drugs', "version" ) PerformHttpRequest(url, function(err, text, headers) diff --git a/server/xtc.lua b/server/xtc.lua index 19eb48e..57c19aa 100644 --- a/server/xtc.lua +++ b/server/xtc.lua @@ -3,9 +3,9 @@ local QBCore = exports['qb-core']:GetCoreObject() local activePresses = {} RegisterServerEvent('md-drugs:server:stealisosafrole', function(num) local src = source - local Player = getPlayer(src) if not checkLoc(src, 'isosafrole',num) then return end if AddItem(src, "isosafrole", 1) then + end end) diff --git a/shared/consumables.lua b/shared/consumables.lua index 435a921..9c193d3 100644 --- a/shared/consumables.lua +++ b/shared/consumables.lua @@ -3,145 +3,3 @@ Consumables.defaulttime = 4000 Consumables.defaultanim = 'pflag2' Consumables.defaultprogresstext = 'Consuming ' -- it will always show the label of the item being used after what you put here, make sure to keep the space at the end :) Consumables.defaultstatval = 0 ---[[ - effect options - alien - ecstacy - meth - coke - trevor - none -]] - ---[[ -add = {} -health = number -- amount of health to give -stress = number -- number of stress to give -speed = number -- number of seconds you a fast boi -hunger = number -- number of hunger to fill -thirst = number -- same shit -strength = number -- how long you are strong boi - -]] -Consumables.Items = { - -- meth - methbags = { time = 4000, effect = 'meth', anim = "smoke", progressbartext = "Injesting", - add = {health = -20, stress = -10, speed = 40, strength = 10, thirst = -30}}, - cokebaggy = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, - cokebaggystagetwo = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, - cokebaggystagethree = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, - -- heroin - heroin_ready = { anim = 'shootup', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - heroin_readystagetwo = { anim = 'shootup', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - heroin_readystagethree = { anim = 'shootup', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - -- crack - baggedcracked = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, - baggedcrackedstagetwo = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, - baggedcrackedstagethree = { anim = 'smell', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - -- xtc - white_playboys = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_playboys2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_playboys3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_playboys4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_playboys = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_playboys2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_playboys3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_playboys4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_playboys = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_playboys2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_playboys3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_playboys4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_playboys = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_playboy2s = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_playboys3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_playboys4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_aliens = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_aliens2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_aliens3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_aliens4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_aliens = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_aliens2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_aliens3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_aliens4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_aliens = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_aliens3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_aliens2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_aliens4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_aliens = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_aliens2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_aliens3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_aliens4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_pl = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_pl2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_pl3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_pl4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_pl = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_pl2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_pl3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_pl4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_pl = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_pl2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_pl3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_pl4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_pl = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_pl2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_pl3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_pl4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_trolls = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_trolls2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_trolls3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_trolls4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_trolls = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_trolls2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_trolls3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_trolls4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_trolls = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_trolls2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_trolls3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_trolls4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_trolls = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_trolls2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_trolls3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_trolls4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_cats2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_cats3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_cats4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - white_cats = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_cats = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_cats3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_cats2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - blue_cats4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_cats = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_cats2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_cats3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - red_cats4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_cats = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_cats2 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_cats3 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - orange_cats4 = { anim = 'edible', time = 1000, effect = 'ecstacy', add = { stress = -10 }}, - -- weed - specialbrownie = { anim = 'edible', effect = 'alien', add = { hunger = 10, stress = -10 }}, - specialcookie = { anim = 'edible', effect = 'alien', add = { hunger = 10, stress = -10 }}, - specialchocolate = { anim = 'edible', effect = 'alien', add = { hunger = 10, stress = -10 }}, - specialmuffin = { anim = 'edible', effect = 'alien', add = { hunger = 10, stress = -10 }}, - blunt = { anim = 'smokeweed', effect = 'alien', add = { stress = -10 }}, - dextroblunts = { anim = 'smokeweed', effect = 'alien', add = { stress = -10 }}, - leanblunts = { anim = 'smokeweed', effect = 'alien', add = { stress = -10 }}, - chewyblunt = { anim = 'smokeweed', effect = 'alien', add = { stress = -10 }}, - -- lean - cupofdextro = { anim = 'cup', effect = 'alien', add = { stress = -10 }}, - cupoflean = { anim = 'cup', effect = 'alien', add = { stress = -10 }}, - -- lsd - smiley_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, - wildcherry_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, - yinyang_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, - pineapple_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, - bart_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, - gratefuldead_tabs = { anim = 'edible', effect = 'trevor', add = { stress = -10 }}, - - -- pharma - vicodin = { anim = 'pill', effect = 'none', add = { health = 20 }}, - adderal = { anim = 'pill', effect = 'none', add = { stress = -20 }}, - morphine = { anim = 'pill', effect = 'none', add = { health = 40 }}, - xanax = { anim = 'pill', effect = 'none', add = { stress = -40 }}, -} From be0dd021666c4caacb09eaaca3c26c5760a325e5 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:44:37 -0800 Subject: [PATCH 36/36] yolo --- client/functions.lua | 19 ++++--------- client/weed.lua | 3 +- server/cocaine.lua | 3 +- server/deliveries.lua | 1 - server/pharma.lua | 3 +- server/recipes.lua | 2 +- server/weed.lua | 64 +++++++++++++++++++++---------------------- shared/config.lua | 7 +++-- 8 files changed, 48 insertions(+), 54 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index c2dc04b..8204e5c 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -641,21 +641,12 @@ function StartRay2() until run == false end - -RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() - Wait(3000) - LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b') - local check = lib.callback.await('md-drugs:server:GetRep', false) - return -end) - -AddEventHandler('onResourceStart', function(resource) - if resource == GetCurrentResourceName() then - LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b') - end -end) - CreateThread(function() + LoadModel('prop_plant_01b') + LoadModel('prop_plant_01a') + LoadModel('prop_cactus_03') + LoadModel('prop_weed_01') + TriggerEvent('weed:init') TriggerEvent('heroin:init') TriggerEvent('coke:init') TriggerEvent('Mescaline:init') diff --git a/client/weed.lua b/client/weed.lua index 4f93edb..9541254 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -33,9 +33,10 @@ end) RegisterNetEvent("weed:init", function() for k, v in pairs (GlobalState.WeedPlant) do local hash = GetHashKey(v.model) - if not HasModelLoaded(hash) then LoadModel(hash) end + lib.requestModel('prop_weed_01', 1000) if not v.taken then WeedPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true) + print(WeedPlant[k]) Freeze(WeedPlant[k],true, v.heading) AddSingleModel(WeedPlant[k], {icon = "fas fa-hand",label = Lang.targets.weed.pick, action = function() pick(k) end}, k) end diff --git a/server/cocaine.lua b/server/cocaine.lua index e34859c..de14b02 100644 --- a/server/cocaine.lua +++ b/server/cocaine.lua @@ -128,11 +128,12 @@ for k, v in pairs (cokecut) do CUI(k, function(source, item) local src = source local Player = getPlayer(src) + if not Player.Functions.GetItemByName('bakingsoda') then Notifys(src, 'You Need Baking Soda For this', 'error') return end if Player.Functions.GetItemByName(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') if not check then return end - if RemoveItem(src, k, 1) and RemoveItem(src, k, 1) then + if RemoveItem(src, k, 1) and RemoveItem(src, 'bakingsoda', 1) then AddItem(src, 'loosecoke', v) end end diff --git a/server/deliveries.lua b/server/deliveries.lua index d39b8b8..b62d4aa 100644 --- a/server/deliveries.lua +++ b/server/deliveries.lua @@ -79,7 +79,6 @@ local dloc = { {coords = vector4(106.24, -1280.32, 29.24, 350.89)}, {coords = vector4(223.98, 121.53, 102.76, 259.68)}, {coords = vector4(102.19, -255.02, 50.05, 83.59)}, - } lib.callback.register('md-drugs:server:getDealers', function(data) local check = MySQL.query.await('SELECT * FROM dealers', {}) diff --git a/server/pharma.lua b/server/pharma.lua index 62ea2d3..3949ddf 100644 --- a/server/pharma.lua +++ b/server/pharma.lua @@ -2,10 +2,11 @@ local QBCore = exports['qb-core']:GetCoreObject() local function GetJob(source) local src = source - local Player = getPlayer(src) + local Player = getPlayer(src) if Player.PlayerData.job.type == 'ems' then return true else + Notifys(src, 'You Must Be EMS To Do This', 'error') return false end end diff --git a/server/recipes.lua b/server/recipes.lua index bf0fae3..fc7ce8b 100644 --- a/server/recipes.lua +++ b/server/recipes.lua @@ -48,7 +48,7 @@ local recipe = { }, fillneedle = { tier1 = {take = {heroinvial = 1, needle = 1}, give = {heroin_ready = 1}}, - tier2 = {take = {heroin_readystagetwo = 1, needle = 1}, give = {heroin_readystagetwo = 1}}, + tier2 = {take = {heroinvialstagetwo = 1, needle = 1}, give = {heroin_readystagetwo = 1}}, tier3 = {take = {heroinvialstagethree = 1, needle = 1}, give = {heroin_readystagethree = 1}}, } }, diff --git a/server/weed.lua b/server/weed.lua index 27f04a8..8e87e36 100644 --- a/server/weed.lua +++ b/server/weed.lua @@ -1,38 +1,38 @@ local QBCore = exports['qb-core']:GetCoreObject() local weedPlant = { - { location = vector3(1049.63, -3202.12, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.85, -3202.15, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.01, -3202.22, -39.13), heading = 25.16, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.99, -3202.15, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1053.08, -3201.11, -39.13), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.91, -3199.99, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1053.02, -3198.97, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.95, -3198.93, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.96, -3199.86, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.93, -3201.17, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.98, -3201.13, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.89, -3200.07, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.89, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.72, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.98, -3200.1, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.82, -3201.01, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1053.07, -3194.51, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.97, -3195.55, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.82, -3196.58, -39.15), heading = 25.16, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1052.94, -3197.59, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.92, -3197.54, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.88, -3196.61, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.82, -3195.52, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1051.95, -3194.38, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.88, -3194.31, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.78, -3195.29, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.76, -3196.49, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1050.77, -3197.62, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.64, -3197.61, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.64, -3196.59, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.62, -3195.51, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, - { location = vector3(1049.66, -3194.36, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"}, + { location = vector3(1049.63, -3202.12, -36.75), heading = 334.49, model = "prop_weed_01"}, + { location = vector3(1050.85, -3202.15, -36.75), heading = 329.56, model = "prop_weed_01"}, + { location = vector3(1052.01, -3202.22, -36.75), heading = 25.16, model = "prop_weed_01"}, + { location = vector3(1052.99, -3202.15, -36.75), heading = 21.52, model = "prop_weed_01"}, + { location = vector3(1053.08, -3201.11, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1052.91, -3199.99, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1053.02, -3198.97, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1051.95, -3198.93, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1051.96, -3199.86, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1051.93, -3201.17, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1050.98, -3201.13, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1050.89, -3200.07, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1050.89, -3198.95, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1049.72, -3198.95, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1049.98, -3200.1, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1049.82, -3201.01, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1053.07, -3194.51, -36.75), heading = 334.49, model = "prop_weed_01"}, + { location = vector3(1052.97, -3195.55, -36.75), heading = 329.56, model = "prop_weed_01"}, + { location = vector3(1052.82, -3196.58, -36.75), heading = 25.16, model = "prop_weed_01"}, + { location = vector3(1052.94, -3197.59, -36.75), heading = 21.52, model = "prop_weed_01"}, + { location = vector3(1051.92, -3197.54, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1051.88, -3196.61, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1051.82, -3195.52, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1051.95, -3194.38, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1050.88, -3194.31, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1050.78, -3195.29, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1050.76, -3196.49, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1050.77, -3197.62, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1049.64, -3197.61, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1049.64, -3196.59, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1049.62, -3195.51, -36.75), heading = 202.97, model = "prop_weed_01"}, + { location = vector3(1049.66, -3194.36, -36.75), heading = 202.97, model = "prop_weed_01"}, } GlobalState.WeedPlant = weedPlant diff --git a/shared/config.lua b/shared/config.lua index 2448a44..ea659b4 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -6,7 +6,7 @@ Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, hero Config.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total Config.RequestModelTime = 30000 -- if you need more time than this, uhhhh wow Config.FancyCokeAnims = true -- if you want multi location this needs to be false -Config.Inventory = 'qb' -- qb or ox, other if you dont use ox just mark as qb + Config.Joblock = false -- if you want weed to be a job Config.weedjob = "" -- what the job name is Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline @@ -14,7 +14,7 @@ Config.MethHeist = false Config.SuccessfulChance = 90 --- this is the chance of a Success wholesale 1-100 Config.AlertPoliceWholesale = 90 -- 1-100 of how often it will alert police Config.WholesaleTimeout = 600 -- time in seconds to get to the location -Config.PoliceCount = 2 -- Amount of police required +Config.PoliceCount = 0 -- Amount of police required Config.PoliceAlertOxy = 90 -- This is a % out of 100 to alert police ----------------------------------- TierSystem levels ** ONLY IN USE IF CONFIG.TIERSYTEM IS TRUE @@ -27,6 +27,7 @@ Config.Notify = 'ox' -- -- either 'qb' or 'ox' or 'okok' Config.Phone = 'qb' -- either 'qb' or 'yflip' or 'qs' Config.Dispatch = 'ps' -- either 'ps', 'cd', 'core', 'aty' Config.Target = 'ox' -- qb or ox +Config.Inventory = 'ox' -- qb or ox, other if you dont use ox just mark as qb Config.Minigames = { ps_circle = {amount = 2, speed = 8,}, ps_maze = {timelimit = 15}, @@ -45,7 +46,7 @@ Config.Minigames = { glspot = {gridSize = 6, timeLimit = 999999, charSet = "alphabet", required = 10}, glmath = {timeLimit = 300000}, } -Config.minigametype = 'blrapidlines' -- look above for options or choose none if you dont want any minigames +Config.minigametype = 'ox' -- look above for options or choose none if you dont want any minigames -------- Woah Where did like all the locations go? --- read the readme to find out \ No newline at end of file