👁️qb-target
Always watching you...
Introduction
qb-target is a targeting solution that allows interaction with any predefined entity, model, entity type or polyzone. While activated you can easily and safely replace markers and distance checking, instead of relying on intuitive design to improve player experiences and optimize interaction.
Features
Maintains compatibility with bt-target while providing improved utility and performance
Optimized and improved raycasting function allows interaction with a wider range of entities
Add generic options to apply for all players, peds, vehicles, or objects
Trigger an event, function or command after clicking an option, with the ability to pass any data through
Define distance on a per-option or overall basis when triggering a target option
Ability to redefine or remove options and add new options without replacing old ones
Update the option list when moving towards or away from a target with variable distances on their options
Support for entity bones, with built-in tables for opening vehicle doors
Support checking for job, gang, citizenid, items, or specific entities
Utilise the
canInteractfunction for advanced checks to show or hide an option based on any triggerPed spawner to spawn peds and assign target options to them all in one place
AddCircleZone
Adds a circular zone that players can interact with
name:
stringcenter:
vector3radius:
floatoptions:
tablename:
stringdebugPoly:
booleanuseZ:
boolean(optional)
targetoptions:
tableoptions:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)drawDistance:
number(optional)drawColor:
table(optional)successDrawColor:
table(optional)
distance:
float
AddBoxZone
Adds a rectangular zone that players can interact with
name:
stringcenter:
vector3length:
floatwidth:
floatoptions:
tablename:
stringheading:
floatdebugPoly:
booleanminZ:
floatmaxZ:
float
targetoptions:
tableoptions:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)drawDistance:
number(optional)drawColor:
table(optional)successDrawColor:
table(optional)
distance:
float
AddPolyZone
Adds a custom-shaped polygon zone that players can interact with
name:
stringpoints:
tableA list of
vector2points defining the polygon (minimum of 3, must be in drawing order).
options:
tablename:
stringdebugPoly:
booleanminZ:
floatmaxZ:
float
targetoptions:
tableoptions:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)drawDistance:
number(optional)drawColor:
table(optional)successDrawColor:
table(optional)
distance:
float
AddComboZone
Adds a composite zone made up of two or more PolyZones (CircleZone, BoxZone, or PolyZone), treated as a single interactive area
zones:
tableA list of zone objects (must be at least 2), e.g. instances created using
BoxZone:Create(...).
options:
tablename:
stringdebugPoly:
boolean
targetoptions:
tableoptions:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)drawDistance:
number(optional)drawColor:
table(optional)successDrawColor:
table(optional)
distance:
float
AddTargetBone
Adds targetable interaction options to specific bones of vehicles
bones:
stringortableA single bone name or a list of bone names (e.g.
"bonnet"or{ "bonnet", "boot" }).
parameters:
tableoptions:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)
distance:
float
RemoveTargetBone
Removes targeting options from one or more bones on all applicable entities registered via AddTargetBone
bones:
stringortable
AddTargetEntity
Adds interaction options to a specific entity (such as a ped, vehicle, or object)
entity:
numberortableThe entity instance or a list of entity instances (from
CreatePed,CreateVehicle, etc).
parameters:
tableoptions:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)
distance:
float
RemoveTargetEntity
Removes specific target options from an entity by label(s).
entity:
numberortablelabels:
stringortable
AddEntityZone
Adds a target zone that is dynamically attached to a specific entity. Useful for treating an entity like a movable zone (e.g. attaching interaction to a ped or vehicle)
name:
stringentity:
numberThe target entity's ID (such as a ped or vehicle created via
CreatePedorCreateVehicle).
options:
tablename:
stringdebugPoly:
boolean
targetoptions:
tableoptions:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)drawDistance:
number(optional)drawColor:
table(optional)successDrawColor:
table(optional)
distance:
float
RemoveEntityZone
Removes a previously registered entity-based zone
name:
string
AddTargetModel
Adds interaction options to one or more models, allowing players to interact with all entities of those models (e.g. specific ped, vehicle, or prop types)
models:
stringortableA model name or a list of model names (e.g.
"prop_atm_01"or{ "prop_atm_01", "prop_atm_02" }).
parameters:
tableoptions:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)
distance:
float
RemoveTargetModel
Removes interaction options from one or more models.
models:
stringortablelabels:
stringortable
AddGlobalPed
Adds interaction options that apply to all peds in the world. Useful for universal interactions like restraining or identifying NPCs
parameters: table
options:
tablenum:
number(optional)type:
stringevent:
stringicon:
stringlabel:
stringtargeticon:
string(optional)item:
string(optional)action:
function(optional)canInteract:
function(optional)job:
stringortable(optional)gang:
stringortable(optional)citizenid:
stringortable(optional)
distance:
float
RemoveGlobalPed
Removes global interaction options from all peds.
identifier:
string
AddGlobalVehicle
Adds interaction options to all vehicles globally.
parameters:
table
RemoveGlobalVehicle
Removes global options from all vehicles.
labels:
stringortable
AddGlobalObject
Adds interaction options to all static world objects globally.
parameters:
table
RemoveGlobalObject
Removes global options from all world objects.
labels:
stringortable
AddGlobalPlayer
Adds interaction options to all player entities globally
parameters:
table
RemoveGlobalPlayer
Removes global options that apply to all player entities.
labels:
stringortable
SpawnPed
Spawns one or multiple peds with optional animations, relationships, weapons, and targeting
datatable:
tablemodel:
stringcoords:
vector4freeze:
boolean(optional)invincible:
boolean(optional)blockevents:
boolean(optional)animDict:
string(optional)anim:
string(optional)flag:
number(optional)scenario:
string(optional)pedrelations:
table(optional)groupname:
stringtoowngroup:
numbertoplayer:
number
weapon:
table(optional)name:
stringammo:
numberhidden:
boolean
target:
table(optional)useModel:
booleanoptions:
tabletype:
stringevent:
stringicon:
stringlabel:
string
distance:
float
action:
function(optional)
RemoveSpawnedPed
Removes one or more peds previously spawned with SpawnPed
peds:
numberortable
RemoveGlobalTypeOptions
Removes options from a global target type (e.g. peds, vehicles).
type:
number(1 for peds, 2 for vehicles, 3 for objects, 4 for players)labels:
stringortable
RemoveZone
Removes a zone that was previously added using AddCircleZone, AddBoxZone, AddPolyZone, or AddComboZone
name:
string
RaycastCamera
Performs a raycast from the camera's viewpoint to detect the closest entity in the crosshair.
flag:
numberplayerCoords:
vector3
AllowTargeting
Enables or disables qb-target interactions for the player
allow:
boolean
Last updated
Was this helpful?
