Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions pages/ox_target/Functions/Client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,37 @@ exports.ox_target:disableTargeting(state)
- state: `boolean`
- Setting `state` to `true` will turn off the targeting eye if it is active and prevent it from reopening until `state` is set to `false` again.

## isActive

Checks if the targeting system is currently active.

```lua
exports.ox_target:isActive()
```

Return:
- `boolean` - Returns `true` if the targeting system is active, otherwise `false`.


## getTargetOptions

Retrieves targeting options for a specific entity.

```lua
exports.ox_target:getTargetOptions(entity, entityType, model)
```

- entity?: `number` - The entity handle
- entityType?: `number` - The type of entity (1 for peds, 2 for vehicles, 3 for objects)
- model?: `number` - The model hash of the entity

Return:
- `table` - Returns a table containing the target options for the entity:
- global: Options for the entity type (peds, vehicles, or objects)
- model: Options for the specific model
- entity: Options for the networked entity
- localEntity: Options for the local entity

## addGlobalOption

Creates new targetable options which are displayed at all times.
Expand Down Expand Up @@ -247,6 +278,22 @@ exports.ox_target:addPolyZone(parameters)
Return:
- id: `number`

## zoneExists

Checks if a zone with the given ID exists.

```lua
exports.ox_target:zoneExists(id)
```

- id: `number` or `string`
- The `number` id that is returned by [addSphereZone](#addspherezone), [addBoxZone](#addboxzone), or [addPolyZone](#addpolyzone)
**OR**
- The `string` name given to the zone.

Return:
- `boolean` - Returns `true` if the zone exists, otherwise `false`.

## removeZone

Removes a targetable zone with the given id (returned by addBoxZone/addSphereZone).
Expand Down