diff --git a/modules/target/ox_target/client.lua b/modules/target/ox_target/client.lua index 59a8b9d..6dc06cd 100644 --- a/modules/target/ox_target/client.lua +++ b/modules/target/ox_target/client.lua @@ -100,6 +100,26 @@ Target.AddBoxZone = function(name, coords, size, heading, options) return target end +---comment +---@param name string +---@param coords vector3 +---@param radius number +---@param heading number -- unused, but kept for compatibility +---@param options table +---@return number +Target.AddSphereZone = function(name, coords, radius, heading, options) + options = Target.FixOptions(options) + local target = ox_target:addSphereZone({ + coords = coords, + radius = radius, + name = name, + debug = targetDebug, + options = options + }) + table.insert(targetZones, { name = name, id = target, creator = GetInvokingResource() }) + return target +end + Target.RemoveGlobalPlayer = function() ox_target:removeGlobalPlayer() end diff --git a/modules/target/qb-target/client.lua b/modules/target/qb-target/client.lua index 9df9315..d31c065 100644 --- a/modules/target/qb-target/client.lua +++ b/modules/target/qb-target/client.lua @@ -92,6 +92,18 @@ Target.AddBoxZone = function(name, coords, size, heading, options) table.insert(targetZones, { name = name, creator = GetInvokingResource() }) end +Target.AddSphereZone = function(name, coords, radius, options) + options = Target.FixOptions(options) + exports['qb-target']:AddCircleZone(name, coords, radius, { + name = name, + debugPoly = targetDebug, + }, { + options = options, + distance = options.distance or 1.5, + }) + table.insert(targetZones, { name = name, creator = GetInvokingResource() }) +end + Target.RemoveGlobalPlayer = function() exports['qb-target']:RemoveGlobalPlayer() end