diff --git a/modules/target/ox_target/client.lua b/modules/target/ox_target/client.lua index ee67df0..8fedecd 100644 --- a/modules/target/ox_target/client.lua +++ b/modules/target/ox_target/client.lua @@ -97,6 +97,21 @@ Target.RemoveLocalEntity = function(entities, optionNames) ox_target:removeLocalEntity(entities, optionNames) end +---This will add a networked entity to the target system. +---@param netids table | number +---@param options table +Target.AddNetworkedEntity = function(netids, options) + options = Target.FixOptions(options) + ox_target:addEntity(netids, options) +end + +---This will remove a networked entity from the target system. +---@param netids table | number +---@param optionNames string +Target.RemoveNetworkedEntity = function(netids, optionNames) + ox_target:removeEntity(netids, 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 models number | table ---@param options table diff --git a/modules/target/qb-target/client.lua b/modules/target/qb-target/client.lua index dcd3df1..2aed360 100644 --- a/modules/target/qb-target/client.lua +++ b/modules/target/qb-target/client.lua @@ -80,6 +80,21 @@ Target.AddGlobalVehicle = function(options) }) end +---This will add a networked entity to the target system. +---@param netids table | number +---@param options table +Target.AddNetworkedEntity = function(netids, options) + options = Target.FixOptions(options) + qb_target:AddTargetEntity(netids, options) +end + +---This will remove a networked entity from the target system. +---@param netids table | number +---@param optionNames string +Target.RemoveNetworkedEntity = function(netids, optionNames) + qb_target:RemoveTargetEntity(netids, optionNames) +end + ---This will remove target options from all vehicles. ---@param options table Target.RemoveGlobalVehicle = function(options) diff --git a/modules/target/sleepless_interact/client.lua b/modules/target/sleepless_interact/client.lua index a35c747..de80861 100644 --- a/modules/target/sleepless_interact/client.lua +++ b/modules/target/sleepless_interact/client.lua @@ -80,6 +80,21 @@ Target.RemoveGlobalVehicle = function(options) sleepless_interact:removeGlobalVehicle(assembledLables) end +---This will add a networked entity to the target system. +---@param netids table | number +---@param options table +Target.AddNetworkedEntity = function(netids, options) + options = Target.FixOptions(options) + sleepless_interact:addEntity(netids, options) +end + +---This will remove a networked entity from the target system. +---@param netids table | number +---@param optionNames string +Target.RemoveNetworkedEntity = function(netids, optionNames) + sleepless_interact:removeEntity(netids, optionNames) +end + ---This will generate targets on non networked entites with the passed options. ---@param entities number | table ---@param options table