TargetOptions
All target actions are formated as an array containing objects with the following properties.
TargetOption
- label:
string
- name?:
string
- An identifier used when removing an option.
- icon?:
string
- Name of a Font Awesome (opens in a new tab) icon.
- iconColor?:
string
- distance?:
number
- The max distance to display the option.
- bones?:
string
orstring[]
- A bone name or array of bone names (see GetEntityBoneIndexByName (opens in a new tab)).
- offset?:
vector3
- Offset the targetable area of an entity, relative to the model dimensions.
- offsetAbsolute?:
vector3
- Offset the targetable area of an entity, relative to the entity's world coords.
- offsetSize?:
number
- The radius of the targetable area for an entity offset.
- groups?:
string
orstring[]
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?:
string
orstring[]
ortable<string, number>
- An item, array of items, or pairs of items-count required to show the option.
- Items are framework dependent.
- anyItem?:
boolean
- Only 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?:
string
- The option is only displayed when a menu has been set with openMenu.
- openMenu?:
string
- Sets the current menu name, displaying only options for the menuName.
- onSelect?:
function(data)
- export?:
string
- event?:
string
- serverEvent?:
string
- command?:
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:
table
- entity:
number
- The id of the entity hit by the shape test. If triggering a server event, this is the network id instead.
- coords:
vector3
- The resulting coordinates where the shape test hit a collision.
- distance:
number
- The player's distance from the coords.
- zone?:
number
- The id of the selected zone, if applicable.
- entity: