ug-target. Options belong to the resource that added them and are removed when it stops. Mistakes raise at once, with the export name and the field.
Where options go
Each
Add has a Remove with the same first argument and optional option names: RemoveModel('prop_atm_01', 'atm'). Without names, every option of the calling resource goes. RemoveZone(idOrName) and ZoneExists(idOrName) take a zone id or name.
options is one option or a list of up to 64. An option with the name of one your resource already added replaces it.
Option fields
An option needs one of
onSelect, event, command, export, serverAction, serverEvent or openMenu. Several MAY be set: they run in that order.
Conditions
showDisabled is off. Server actions check the same conditions again on the server.
Context
onSelect, canInteract, event and export receive:
Submenus
State
Disable(state): turns targeting off while any resource asks, such as a phone or a cutscene.IsActive(): true while the player aims.- The local event
ug-target:Toggledfires withtrueandfalsewhen targeting opens and closes, for HUDs.