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
This commit is contained in:
Mustache Dom committed 2024-11-22 12:26:27 -08:00
1 parent c2fddd6144
commit cdd26ab465
10 files changed
+149 -64

No files matched your search

+5 -3
View File
@@ -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)
+24 -22
View File
@@ -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
-19
View File
@@ -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)
+2 -1
View File
@@ -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')
+3
View File
@@ -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)