Client - Functions
Client
All exports with the options argument expect a table with the targeting properties here.
For some examples you can refer to defaults.lua or debug.lua.
disableTargeting
Toggle the availability of the targeting menu.
exports.ox_target:disableTargeting(state)state:
booleanSetting
statetotruewill turn off the targeting eye if it is active and prevent it from reopening untilstateis set tofalseagain.
addGlobalOption
Creates new targetable options which are displayed at all times.
exports.ox_target:addGlobalOption(options)options:
TargetOptions
removeGlobalOption
Removes all options from the global options list with the option names.
exports.ox_target:removeGlobalOption(optionNames)optionNames:
stringorstring[]
addGlobalObject
Creates new targetable options for all Object entity types.
exports.ox_target:addGlobalObject(options)options:
TargetOptions
removeGlobalObject
Removes all options from the global Object list with the option names.
exports.ox_target:removeGlobalObject(optionNames)optionNames:
stringorstring[]
addGlobalPed
Creates new targetable options for all Ped entity types (excluding players).
exports.ox_target:addGlobalPed(options)options:
TargetOptions
removeGlobalPed
Removes all options from the global Ped list with the option names.
exports.ox_target:removeGlobalPed(optionNames)optionNames:
stringorstring[]
addGlobalPlayer
Creates new targetable options for all Player entities.
exports.ox_target:addGlobalPlayer(options)options:
TargetOptions
removeGlobalPlayer
Removes all options from the global Player list with the option names.
exports.ox_target:removeGlobalPlayer(optionNames)optionNames:
stringorstring[]
addGlobalVehicle
Creates new targetable options for all Vehicle entity types.
exports.ox_target:addGlobalVehicle(options)options:
TargetOptions
removeGlobalVehicle
Removes all options from the global Vehicle list with the option names.
exports.ox_target:removeGlobalVehicle(optionNames)optionNames:
stringorstring[]
addModel
Creates new targetable options for a specific model or list of models.
exports.ox_target:addModel(models, options)models:
numberorstringorArray<number | string>options:
TargetOptions
removeModel
Removes all options from the models list with the option names.
exports.ox_target:removeModel(models, optionNames)models:
numberorstringorArray<number | string>optionNames:
stringorstring[]
addEntity
Creates new targetable options for a specific network id or list of network ids (see NetworkGetNetworkIdFromEntity).
exports.ox_target:addEntity(netIds, options)netIds:
numberornumber[]options:
TargetOptions
removeEntity
Removes all options from the networked entities list with the option names.
exports.ox_target:removeEntity(netIds, optionNames)netIds:
numberornumber[]optionNames:
stringorstring[]
addLocalEntity
Creates new targetable options for a specific entity handle or list of entity handles.
exports.ox_target:addLocalEntity(entities, options)entities:
numberornumber[]options:
TargetOptions
removeLocalEntity
Removes all options from the entities list with the option names.
exports.ox_target:removeLocalEntity(entities, optionNames)entities:
numberornumber[]optionNames:
stringorstring[]
addSphereZone
Creates a new targetable sphere zone.
exports.ox_target:addSphereZone(parameters)parameters:
tablecoords:
vector3name?:
stringAn optional name to refer to the zone instead of using the
id.
radius?:
numberdebug?:
booleandrawSprite?:
booleanDraw a sprite at the centroid of the zone. Defaults to
true.
options:
TargetOptions
Return:
id:
number
addBoxZone
Creates a new targetable box zone.
exports.ox_target:addBoxZone(parameters)parameters:
tablecoords:
vector3name?:
stringAn optional name to refer to the zone instead of using the
id.
size?:
vector3rotation?:
numberdebug?:
booleandrawSprite?:
booleanDraw a sprite at the centroid of the zone. Defaults to
true.
options:
TargetOptions
Return:
id:
number
addPolyZone
Creates a new targetable poly zone.
exports.ox_target:addPolyZone(parameters)parameters:
tablepoints:
vector3[]An array of 3d points defining the polygon's shape.
name?:
stringAn optional name to refer to the zone instead of using the
id.
thickness?:
numberThe height of the polygon, defaulting to
4.
debug?:
booleandrawSprite?:
booleanDraw a sprite at the centroid of the zone. Defaults to
true.
options:
TargetOptions
Return:
id:
number
removeZone
Removes a targetable zone with the given id (returned by addBoxZone/addSphereZone).
exports.ox_target:removeZone(id)id:
numberorstringThe
numberid that is returned by addSphereZone, addBoxZone, or addPolyZone ORThe
stringname given to the zone.
Last updated