From ff69aa160db96cc8e1c11d08ed90bcf5ae0055e3 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:59:58 -0400 Subject: [PATCH] AddGlobalPed/RemoveGlobalPed --- modules/target/ox_target/client.lua | 17 +++++++++++++++-- modules/target/qb-target/client.lua | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/modules/target/ox_target/client.lua b/modules/target/ox_target/client.lua index b5b7d17..69a213e 100644 --- a/modules/target/ox_target/client.lua +++ b/modules/target/ox_target/client.lua @@ -79,12 +79,25 @@ Target.AddLocalEntity = function(entities, options) end ---This will remove the target options from a local entity. This is useful for when you want to remove target options from a specific entity. ----@param entity any ----@param labels string | table | nil +---@param entities table +---@param optionNames string | table | nil Target.RemoveLocalEntity = function(entities, optionNames) ox_target:removeLocalEntity(entities, optionNames) end +---This will add target options to all specified models. This is useful for when you want to add target options to all models of a specific type. +---@param options table +Target.AddGlobalPed = function(options) + options = Target.FixOptions(options) + ox_target:addGlobalPed(options) +end + +---This will remove target options from all peds. This is useful for when you want to remove target options from all peds. +---@param options any +Target.RemoveGlobalPed = function(options) + ox_target:removeGlobalPed(options) +end + ---This will add target options to all specified models. This is useful for when you want to add target options to all models of a specific type. ---@param models number | table ---@param options table diff --git a/modules/target/qb-target/client.lua b/modules/target/qb-target/client.lua index 79a6163..f990d8a 100644 --- a/modules/target/qb-target/client.lua +++ b/modules/target/qb-target/client.lua @@ -95,6 +95,20 @@ Target.RemoveLocalEntity = function(entity, labels) qb_target:RemoveTargetEntity(entity, labels) end +---This will add target options to all specified models. This is useful for when you want to add target options to all models of a specific type. +---@param options table +Target.AddGlobalPed = function(options) + options = Target.FixOptions(options) + qb_target:AddGlobalPed(options) +end + +---This will remove target options from all peds. This is useful for when you want to remove target options from all peds. +---@param options any +Target.RemoveGlobalPed = function(options) + qb_target:RemoveGlobalPed(options) +end + + ---This will add target options to all specified models. This is useful for when you want to add target options to all models of a specific type. ---@param models number | table ---@param options table