target
Last updated on
The target eye — hold a key, right-click something in the world, and pick from the rows other modules registered for it.
The player holds the target key (ALT by default), the cursor appears, and a right-click on a person, vehicle, door, prop, surface or empty sky lists the actions that apply to it. Modules register those actions as rows: each row says what it applies to (kinds, records, specific entities, spheres, distance) and can ask its owner at pick time whether it applies (canInteract). Choosing a row calls its onSelect. Use it to give your module world interactions without a key of its own.
| Side | client |
| Requires | none |
| Optional | downed |
| Contract | target v1 — client |
| Config | config/target.lua (shared) |
| Data | none |
- The module ships one row of its own, Show server ID, which shows and copies another player's server id only, enough for a report to staff (see
IDENTIFY). Never the character id or name: staff read those on their name tags. - A
dangerrow asks for a second click (Confirm: <label>) unless it setsconfirm = false; any row can opt in withconfirm = true(row definition). The staff Remove (staff vehicle) asks; Kick and Ban do not, their form confirms. - Lock rows say which way they go: Lock door / Unlock door, Lock vehicle / Unlock vehicle.
- The eye closes and will not open while the player is down.
- The row under the pointer (or focused) steps out like the menu's chosen row: full red, lit plate, a small 3D pop; danger rows pop in the alarm colour; an open folder stays lit without the pop. All rows of a column land together, with no stagger.
- Limits: 48 rows per owner, 128 in total.
- Bands for
orderused by the shipped modules (fromconfig/target.lua): 0–9 the thing itself, 10–19 its state, 20–39 what it holds, 40–59 work, 60–89 leaving, 100–999 staff.
Configuration
config/target.lua sets OPX.Config.MODULES.target. Numbers are clamped to the ranges shown.
Scheduler intervals below about 100 ms run at roughly 100 ms unless another job keeps the loop busy.
Refusal codes
| Code | Meaning |
|---|---|
invalid_caller | owner is missing or empty. |
invalid_owner | owner is not a running module or resource, or not a valid name. |
invalid_options | definitions is not a table or not a list of 1–32. |
invalid_or_duplicate_id | A batch has a missing or repeated id. |
invalid_option | Bad id, label or onSelect. |
invalid_predicate / invalid_checked | Bad canInteract / checked. |
invalid_description, invalid_group, invalid_icon, invalid_distance, invalid_order, invalid_types, invalid_records, invalid_entities, invalid_spheres, invalid_data | That field breaks its rule. |
invalid_enabled, invalid_networked, invalid_allowSelf, invalid_selfOnly, invalid_danger | That field is not a boolean. |
invalid_self_filter | selfOnly without allowSelf, or with types lacking player. |
option_limit | 48 rows for this owner, or 128 in total. |
not_owner | The token is unknown or belongs to another owner. |
option_not_found | Unregister on an unknown token. |
invalid_patch | patch is not a table, or changes id. |
invalid_tokens | tokens is not a list of 1–32. |
expected_boolean | SetEnabled / SetTargetingEnabled value is not a boolean. |