ox_target
TargetOptions
All target actions are formated as an array containing objects with the following properties.
TargetOption
label:
stringname?:
stringAn identifier used when removing an option.
icon?:
stringName of a Font Awesome icon.
iconColor?:
stringdistance?:
numberThe max distance to display the option.
bones?:
stringorstring[]A bone name or array of bone names (see GetEntityBoneIndexByName).
offset?:
vector3Offset the targetable area of an entity, relative to the model dimensions.
offsetAbsolute?:
vector3Offset the targetable area of an entity, relative to the entity's world coords.
offsetSize?:
numberThe radius of the targetable area for an entity offset.
groups?:
stringorstring[]ortable<string, number>A group, array of groups, or pairs of groups-grades required to show the option.
Groups are framework dependent, and may refer to jobs, gangs, etc.
items?:
stringorstring[]ortable<string, number>An item, array of items, or pairs of items-count required to show the option.
Items are framework dependent.
anyItem?:
booleanOnly require a single item from the items table to exist.
canInteract?:
function(entity, distance, coords, name, bone)Options will always display if this is undefined.
menuName?:
stringThe option is only displayed when a menu has been set with openMenu.
openMenu?:
stringSets the current menu name, displaying only options for the menuName.
onSelect?:
function(data)export?:
stringevent?:
stringserverEvent?:
stringcommand?:
string
Callback
This is the data returned to a registered callback or event for selected option.
A selected option will trigger a single action, in order of priority:
onSelect
export
event
server event
command
data:
tableentity:
numberThe id of the entity hit by the shape test. If triggering a server event, this is the network id instead.
coords:
vector3The resulting coordinates where the shape test hit a collision.
distance:
numberThe player's distance from the coords.
zone?:
numberThe id of the selected zone, if applicable.
Last updated