added global options to remove exploit for tables

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-03-17 20:05:09 -07:00
1 parent aaa60b9a2c
commit 27b9f75a6e
3 files changed
+62 -12

No files matched your search

+11 -2
View File
@@ -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())