Main/resources/[jobs]/[civ]/gg_hunting/bridge/[target]/qb-target/client.lua
2025-06-07 08:51:21 +02:00

34 lines
No EOL
1.2 KiB
Lua

if GetResourceState('qb-target') ~= 'started' then return end
if GetResourceState('ox_target') == 'started' then return end
if ScriptUtility.Utility.Debug then print('DEBUG qb-target Detected') end
BridgeTargets = {}
Target = {
createEntityTarget = function(entity, opts, dist)
local options = { options = opts, distance = dist }
exports['qb-target']:AddTargetEntity(entity, options)
end,
deleteEntityTarget = function(entity, label)
exports['qb-target']:RemoveTargetEntity(entity, label)
end,
AddGlobalVehicle = function(options)
-- Extract the distance from the first option
local dist = options.options[1].distance or 2.5 -- Default to 2.5 if not set in options
-- Call the AddGlobalVehicle export with options and distance
exports['qb-target']:AddGlobalVehicle({
options = options.options,
distance = dist
})
end,
-- Define the AddGlobalObject function similarly, if needed
AddGlobalObject = function(options)
local dist = options.options[1].distance or 2.5
exports['qb-target']:AddGlobalObject({
options = options.options,
distance = dist
})
end,
}