From 27b9f75a6ed4618a1cb03f61b9e44973bb845093 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sun, 17 Mar 2024 20:05:09 -0700 Subject: [PATCH] added global options to remove exploit for tables --- client/heroin.lua | 13 +++++++++++-- client/lsd.lua | 17 +++++++++++++---- client/xtc.lua | 44 ++++++++++++++++++++++++++++++++++++++------ 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/client/heroin.lua b/client/heroin.lua index 6b30569..7785868 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -1,7 +1,7 @@ local QBCore = exports['qb-core']:GetCoreObject() local CocaPlant = {} local PoppyPlants = {} - +local herointable = false function LoadModel(hash) hash = GetHashKey(hash) RequestModel(hash) @@ -187,11 +187,16 @@ end) RegisterNetEvent("md-drugs:client:setheroinlabkit") AddEventHandler("md-drugs:client:setheroinlabkit", function() +if herointable then + QBCore.Functions.Notify('You Already Have A Table Out', 'error') +else + local PedCoords = GetEntityCoords(PlayerPedId()) TriggerEvent('animations:client:EmoteCommandStart', {'uncuff'}) + herointable = true ClearPedTasks(PlayerPedId()) heroinlabkit = CreateObject("v_ret_ml_tablea", PedCoords.x+1, PedCoords.y+1, PedCoords.z-1, true, false) - SetVehicleOnGroundProperly(heroinlabkit) + PlaceObjectOnGroundProperly(heroinlabkit) exports['qb-target']:AddTargetEntity(heroinlabkit, { options = { { @@ -205,9 +210,12 @@ TriggerEvent('animations:client:EmoteCommandStart', {'uncuff'}) event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = "Pick Up", + canInteract = function() + if herointable then return true end end }, } }) +end end) RegisterNetEvent("md-drugs:client:heatliquidheroin") @@ -270,6 +278,7 @@ end) RegisterNetEvent("md-drugs:client:getheroinkitback") AddEventHandler("md-drugs:client:getheroinkitback", function() +herointable = false DeleteObject(heroinlabkit) TriggerServerEvent("md-drugs:server:getheroinlabkitback") ClearPedTasks(PlayerPedId()) diff --git a/client/lsd.lua b/client/lsd.lua index 7fce7f9..b8e69c1 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -1,5 +1,5 @@ local QBCore = exports['qb-core']:GetCoreObject() - +local tableout = false local function loadParticle(dict) if not HasNamedPtfxAssetLoaded(dict) then RequestNamedPtfxAsset(dict) @@ -70,7 +70,11 @@ end) RegisterNetEvent("md-drugs:client:setlsdlabkit") AddEventHandler("md-drugs:client:setlsdlabkit", function() -local PedCoords = GetEntityCoords(PlayerPedId()) +if tableout then + QBCore.Functions.Notify('You Already Have A Table Out', 'error') +else + tableout = true + local PedCoords = GetEntityCoords(PlayerPedId()) TriggerEvent('animations:client:EmoteCommandStart', {'uncuff'}) QBCore.Functions.Progressbar("drink_something", "Setting Table Down", 1000, false, true, { disableMovement = false, @@ -107,11 +111,15 @@ local PedCoords = GetEntityCoords(PlayerPedId()) event = "md-drugs:client:getlabkitback", icon = "fas fa-box-circle-check", label = "Pick Up", + canInteract = function() + if tableout then return true end end }, } }) -end) -end) + end) +end +end) + RegisterNetEvent("md-drugs:client:getlabkitback") AddEventHandler("md-drugs:client:getlabkitback", function() @@ -127,6 +135,7 @@ AddEventHandler("md-drugs:client:getlabkitback", function() DeleteObject(labkit) TriggerServerEvent('md-drugs:server:getlabkitback') ClearPedTasks(PlayerPedId()) + tableout = false end) end) diff --git a/client/xtc.lua b/client/xtc.lua index 4682269..c617388 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -1,8 +1,12 @@ local QBCore = exports['qb-core']:GetCoreObject() - +local xtcpress = false RegisterNetEvent("md-drugs:client:setpressquad") AddEventHandler("md-drugs:client:setpressquad", function() +if xtcpress then + QBCore.Functions.Notify('You Have A Press Out Already', 'error') +else local PedCoords = GetEntityCoords(PlayerPedId()) + xtcpress = true TriggerEvent('animations:client:EmoteCommandStart', {'uncuff'}) Wait(4000) ClearPedTasks(PlayerPedId()) @@ -36,14 +40,21 @@ local PedCoords = GetEntityCoords(PlayerPedId()) event = "md-drugs:client:getquadpressback", icon = "fas fa-eye", label = "Pick Up", + canInteract = function() + if xtcpress then return true end end }, } }) +end end) RegisterNetEvent("md-drugs:client:setpresstriple") AddEventHandler("md-drugs:client:setpresstriple", function() -local PedCoords = GetEntityCoords(PlayerPedId()) + if xtcpress then + QBCore.Functions.Notify('You Have A Press Out Already', 'error') + else + local PedCoords = GetEntityCoords(PlayerPedId()) + xtcpress = true TriggerEvent('animations:client:EmoteCommandStart', {'uncuff'}) Wait(4000) ClearPedTasks(PlayerPedId()) @@ -75,14 +86,21 @@ local PedCoords = GetEntityCoords(PlayerPedId()) event = "md-drugs:client:gettriplepressback", icon = "fas fa-eye", label = "Pick Up", + canInteract = function() + if xtcpress then return true end end }, } }) + end end) RegisterNetEvent("md-drugs:client:setpressdual") AddEventHandler("md-drugs:client:setpressdual", function() -local PedCoords = GetEntityCoords(PlayerPedId()) + if xtcpress then + QBCore.Functions.Notify('You Have A Press Out Already', 'error') + else + local PedCoords = GetEntityCoords(PlayerPedId()) + xtcpress = true TriggerEvent('animations:client:EmoteCommandStart', {'uncuff'}) Wait(4000) ClearPedTasks(PlayerPedId()) @@ -117,14 +135,21 @@ local PedCoords = GetEntityCoords(PlayerPedId()) event = "md-drugs:client:getdualpressback", icon = "fas fa-eye", label = "Pick Up", + canInteract = function() + if xtcpress then return true end end }, } }) +end end) RegisterNetEvent("md-drugs:client:setpresssingle") AddEventHandler("md-drugs:client:setpresssingle", function() -local PedCoords = GetEntityCoords(PlayerPedId()) + if xtcpress then + QBCore.Functions.Notify('You Have A Press Out Already', 'error') + else + local PedCoords = GetEntityCoords(PlayerPedId()) + xtcpress = true TriggerEvent('animations:client:EmoteCommandStart', {'uncuff'}) Wait(4000) ClearPedTasks(PlayerPedId()) @@ -160,13 +185,17 @@ local PedCoords = GetEntityCoords(PlayerPedId()) event = "md-drugs:client:getsinglepressback", icon = "fas fa-eye", label = "Pick Up", + canInteract = function() + if xtcpress then return true end end }, } }) +end end) RegisterNetEvent("md-drugs:client:getsinglepressback") -AddEventHandler("md-drugs:client:getsinglepressback", function() +AddEventHandler("md-drugs:client:getsinglepressback", function() +xtcpress = false DeleteObject(singlepress) TriggerServerEvent("md-drugs:server:getsinglepressback") ClearPedTasks(PlayerPedId()) @@ -174,13 +203,15 @@ end) RegisterNetEvent("md-drugs:client:getdualpressback") AddEventHandler("md-drugs:client:getdualpressback", function() +xtcpress = false DeleteObject(dualpress) TriggerServerEvent("md-drugs:server:getdualpressback") ClearPedTasks(PlayerPedId()) end) RegisterNetEvent("md-drugs:client:gettriplepressback") -AddEventHandler("md-drugs:client:gettriplepressback", function() +AddEventHandler("md-drugs:client:gettriplepressback", function() + xtcpress = false DeleteObject(triplepress) TriggerServerEvent("md-drugs:server:gettriplepressback") ClearPedTasks(PlayerPedId()) @@ -188,6 +219,7 @@ end) RegisterNetEvent("md-drugs:client:getquadpressback") AddEventHandler("md-drugs:client:getquadpressback", function() + xtcpress = false DeleteObject(quadpress) TriggerServerEvent("md-drugs:server:getquadpressback") ClearPedTasks(PlayerPedId())