This commit is contained in:
Nordi98 2025-07-29 00:24:49 +02:00
parent f333947ed9
commit 032ec698d8
50 changed files with 27 additions and 5845 deletions

View file

@ -1,26 +0,0 @@
if GetResourceState('ox_target') ~= 'started' or not Config.UseTarget then return end
function AddTargetModel(models, radius, options)
local optionsNames = {}
for i=1, #options do
optionsNames[i] = options[i].name
end
RemoveTargetModel(models, optionsNames)
exports.ox_target:addModel(models, options)
end
function RemoveTargetModel(models, optionsNames)
exports.ox_target:removeModel(models, optionsNames)
end
function AddTargetZone(coords, radius, options)
return exports.ox_target:addSphereZone({
coords = coords,
radius = radius,
options = options
})
end
function RemoveTargetZone(index)
exports.ox_target:removeZone(index)
end

View file

@ -1,49 +0,0 @@
if GetResourceState('ox_target') == 'started' or GetResourceState('qb-target') ~= 'started' or not Config.UseTarget then return end
local Zones = {}
function AddTargetModel(models, radius, options)
local optionsNames = {}
for i=1, #options do
optionsNames[i] = options[i].name
if options[i].onSelect then
local cb = options[i].onSelect
options[i].action = function(entity)
cb({entity = entity})
end
options[i].onSelect = nil
end
end
RemoveTargetModel(models, optionsNames)
exports['qb-target']:AddTargetModel(models, {options = options, distance = 2.5})
end
function RemoveTargetModel(models, optionsNames)
exports['qb-target']:RemoveTargetModel(models, optionsNames)
end
function AddTargetZone(coords, radius, options)
local index
repeat
index = "lottery_coord_" .. math.random(1, 999999999)
until not Zones[index]
for i=1, #options do
if options[i].onSelect then
local cb = options[i].onSelect
options[i].action = function(entity)
cb({entity = entity})
end
options[i].onSelect = nil
end
end
exports['qb-target']:AddCircleZone(index, coords, radius, {name = index}, {
options = options
})
return index
end
function RemoveTargetZone(index)
if not index then return end
Zones[index] = nil
exports['qb-target']:RemoveZone(index)
end

View file

@ -1,37 +0,0 @@
if GetResourceState('ox_target') == 'started' or GetResourceState('qtarget') ~= 'started' or not Config.UseTarget then return end
local Zones = {}
function AddTargetModel(models, radius, options)
local optionsNames = {}
for i=1, #options do
optionsNames[i] = options[i].name
end
RemoveTargetModel(models, optionsNames)
exports['qtarget']:AddTargetModel(models, {options = options, distance = 2.5})
end
function RemoveTargetModel(models, optionsNames)
exports['qtarget']:RemoveTargetModel(models, optionsNames)
end
function AddTargetZone(coords, radius, options)
local index
repeat
index = "lottery_coord_" .. math.random(1, 999999999)
until not Zones[index]
exports['qtarget']:AddBoxZone(index, coords, radius, radius, {
name = index,
heading = 0.0,
minZ = coords.z,
maxZ = coords.z + radius,
}, {
options = options,
})
return index
end
function RemoveTargetZone(index)
Zones[index] = nil
exports['qtarget']:RemoveZone(index)
end