Skip to content

Commit

Permalink
ox_target global options
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Aug 17, 2024
1 parent 28caab7 commit b0463cc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
40 changes: 30 additions & 10 deletions pages/ox_target/Functions/Client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ 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.

## addGlobalOption

Creates new targetable options which are displayed at all times.

```lua
exports.ox_target:addGlobalOption(options)
```

- options: `TargetOptions`

## removeGlobalOption

Removes all options from the global options list with the option names.

```lua
exports.ox_target:removeGlobalOption(optionNames)
```

- optionNames: `string` or `string[]`

## addGlobalObject

Creates new targetable options for all Object entity types.
Expand All @@ -23,7 +43,7 @@ Creates new targetable options for all Object entity types.
exports.ox_target:addGlobalObject(options)
```

- options: `table`
- options: `TargetOptions`

## removeGlobalObject

Expand All @@ -43,7 +63,7 @@ Creates new targetable options for all Ped entity types (excluding players).
exports.ox_target:addGlobalPed(options)
```

- options: `table`
- options: `TargetOptions`

## removeGlobalPed

Expand All @@ -63,7 +83,7 @@ Creates new targetable options for all Player entities.
exports.ox_target:addGlobalPlayer(options)
```

- options: `table`
- options: `TargetOptions`

## removeGlobalPlayer

Expand All @@ -83,7 +103,7 @@ Creates new targetable options for all Vehicle entity types.
exports.ox_target:addGlobalVehicle(options)
```

- options: `table`
- options: `TargetOptions`

## removeGlobalVehicle

Expand All @@ -104,7 +124,7 @@ exports.ox_target:addModel(models, options)
```

- models: `number` or `string` or `Array<number | string>`
- options: `table`
- options: `TargetOptions`

## removeModel

Expand All @@ -126,7 +146,7 @@ exports.ox_target:addEntity(netIds, options)
```

- netIds: `number` or `number[]`
- options: `table`
- options: `TargetOptions`

## removeEntity

Expand All @@ -148,7 +168,7 @@ exports.ox_target:addLocalEntity(entities, options)
```

- entities: `number` or `number[]`
- options: `table`
- options: `TargetOptions`

## removeLocalEntity

Expand All @@ -174,7 +194,7 @@ exports.ox_target:addSphereZone(parameters)
- radius?: `number`
- debug?: `boolean`
- drawSprite?: `boolean`
- options: `table`
- options: `TargetOptions`

Return:
- id: `number`
Expand All @@ -193,7 +213,7 @@ exports.ox_target:addBoxZone(parameters)
- rotation?: `number`
- debug?: `boolean`
- drawSprite?: `boolean`
- options: `table`
- options: `TargetOptions`

Return:
- id: `number`
Expand All @@ -212,7 +232,7 @@ exports.ox_target:addPolyZone(parameters)
- thickness?: `number`
- debug?: `boolean`
- drawSprite?: `boolean`
- options: `table`
- options: `TargetOptions`

Return:
- id: `number`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Options
# TargetOptions

When creating a targetable option you must send an array of options with the following properties.
All target actions are formated as an array containing objects with the following properties.

## Option Parameters
## TargetOption

- label: `string`
- name?: `string`
Expand Down

0 comments on commit b0463cc

Please sign in to comment.