OPX//77
opx_infinitytarget

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.

Sideclient
Requiresnone
Optionaldowned
Contracttarget v1 — client
Configconfig/target.lua (shared)
Datanone
  • 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 danger row asks for a second click (Confirm: <label>) unless it sets confirm = false; any row can opt in with confirm = 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 order used by the shipped modules (from config/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.

KeyDefaultEffect
enabledtruefalse switches the module off.
KEY'ALT'Default key of the mapping opx.target.activate ("Target (hold)"). Players can rebind it in the pause menu.
BLOCK_WEAPON_WHEELtrueBlocks the game's weapon wheel while the module runs (it shares the key).
RAY_DISTANCE12.0Metres the screen ray reaches (1–100). Each row also checks its own distance.
MAX_OPTIONS32Rows listed at once (1–128).
HOVER_MS90Milliseconds between two hover looks (30–1000).
WATCH_MS50Milliseconds between two checks of key, focus and target (10–1000).
RESOLVE_MS25Milliseconds between two slices of a pick (1–1000).
SWEEP_MS2000Milliseconds between two sweeps of stopped owners' rows (250–60000).
REVALIDATE_MS200Milliseconds between two checks that the picked target is still there (50–5000).
LOOKUP_BUDGET_MS1500Total time all canInteract/checked calls of one pick may take (100–10000).
BATCH5Rows resolved per slice (1–16). Keep it small.
IDENTIFY{ ENABLED = true, DISTANCE = 12.0 }The built-in Show server ID row on other players: shows and copies the server id. DISTANCE is clamped to 1–50 m.

Scheduler intervals below about 100 ms run at roughly 100 ms unless another job keeps the loop busy.

Refusal codes

CodeMeaning
invalid_callerowner is missing or empty.
invalid_ownerowner is not a running module or resource, or not a valid name.
invalid_optionsdefinitions is not a table or not a list of 1–32.
invalid_or_duplicate_idA batch has a missing or repeated id.
invalid_optionBad id, label or onSelect.
invalid_predicate / invalid_checkedBad canInteract / checked.
invalid_description, invalid_group, invalid_icon, invalid_distance, invalid_order, invalid_types, invalid_records, invalid_entities, invalid_spheres, invalid_dataThat field breaks its rule.
invalid_enabled, invalid_networked, invalid_allowSelf, invalid_selfOnly, invalid_dangerThat field is not a boolean.
invalid_self_filterselfOnly without allowSelf, or with types lacking player.
option_limit48 rows for this owner, or 128 in total.
not_ownerThe token is unknown or belongs to another owner.
option_not_foundUnregister on an unknown token.
invalid_patchpatch is not a table, or changes id.
invalid_tokenstokens is not a list of 1–32.
expected_booleanSetEnabled / SetTargetingEnabled value is not a boolean.

On this page