removed 90% of logs ( added logs to getrecipe, locationcheck, and fixed wholesale, dealers, and oxyruns, and meth

This commit is contained in:
Mustache Dom committed 2024-11-23 01:58:57 -08:00
1 parent cdd26ab465
commit 5c5f454207
14 files changed
+97 -212

No files matched your search

-1
View File
@@ -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})
+1
View File
@@ -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)
+12 -4
View File
@@ -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)
end)
+17 -11
View File
@@ -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})
+1 -1
View File
@@ -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
-3
View File
@@ -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'}
+13 -25
View File
@@ -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)