mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
* chore: ox_target cleaned up - minor fixes on ox_lib zones * chore: move get/set fuel amount to shared.mdx file * chore: Update removeZone input type https://github.com/overextended/ox_target/commit/021b32d4d52fa58305045177f3dc3c0a969d07e5 * chore: doorlock cleaned up * add missing export * reorder textui sections
230 lines
4.5 KiB
Plaintext
230 lines
4.5 KiB
Plaintext
# Client
|
|
|
|
All exports with the `options` argument expect a table with the targeting properties [here](../Options).
|
|
|
|
## disableTargeting
|
|
|
|
Toggle the availability of the targeting menu.
|
|
|
|
```lua
|
|
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.
|
|
|
|
## addGlobalObject
|
|
|
|
Creates new targetable options for all Object entity types.
|
|
|
|
```lua
|
|
exports.ox_target:addGlobalObject(options)
|
|
```
|
|
|
|
- options: `table`
|
|
|
|
## removeGlobalObject
|
|
|
|
Removes all options from the global Object list with the option names.
|
|
|
|
```lua
|
|
exports.ox_target:removeGlobalObject(optionNames)
|
|
```
|
|
|
|
- optionNames: `string` or `string[]`
|
|
|
|
## addGlobalPed
|
|
|
|
Creates new targetable options for all Ped entity types (excluding players).
|
|
|
|
```lua
|
|
exports.ox_target:addGlobalPed(options)
|
|
```
|
|
|
|
- options: `table`
|
|
|
|
## removeGlobalPed
|
|
|
|
Removes all options from the global Ped list with the option names.
|
|
|
|
```lua
|
|
exports.ox_target:removeGlobalPed(optionNames)
|
|
```
|
|
|
|
- optionNames: `string` or `string[]`
|
|
|
|
## addGlobalPlayer
|
|
|
|
Creates new targetable options for all Player entities.
|
|
|
|
```lua
|
|
exports.ox_target:addGlobalPlayer(options)
|
|
```
|
|
|
|
- options: `table`
|
|
|
|
## removeGlobalPlayer
|
|
|
|
Removes all options from the global Player list with the option names.
|
|
|
|
```lua
|
|
exports.ox_target:removeGlobalPlayer(optionNames)
|
|
```
|
|
|
|
- optionNames: `string` or `string[]`
|
|
|
|
## addGlobalVehicle
|
|
|
|
Creates new targetable options for all Vehicle entity types.
|
|
|
|
```lua
|
|
exports.ox_target:addGlobalVehicle(options)
|
|
```
|
|
|
|
- options: `table`
|
|
|
|
## removeGlobalVehicle
|
|
|
|
Removes all options from the global Vehicle list with the option names.
|
|
|
|
```lua
|
|
exports.ox_target:removeGlobalVehicle(optionNames)
|
|
```
|
|
|
|
- optionNames: `string` or `string[]`
|
|
|
|
## addModel
|
|
|
|
Creates new targetable options for a specific model or list of models.
|
|
|
|
```lua
|
|
exports.ox_target:addModel(models, options)
|
|
```
|
|
|
|
- models: `number` or `string` or `Array<number | string>`
|
|
- options: `table`
|
|
|
|
## removeModel
|
|
|
|
Removes all options from the models list with the option names.
|
|
|
|
```lua
|
|
exports.ox_target:removeModel(models, optionNames)
|
|
```
|
|
|
|
- models: `number` or `string` or `Array<number | string>`
|
|
- optionNames: `string` or `string[]`
|
|
|
|
## addEntity
|
|
|
|
Creates new targetable options for a specific network id or list of network ids (see [NetworkGetNetworkIdFromEntity](https://docs.fivem.net/natives/?_0x9E35DAB6)).
|
|
|
|
```lua
|
|
exports.ox_target:addEntity(netIds, options)
|
|
```
|
|
|
|
- netIds: `number` or `number[]`
|
|
- options: `table`
|
|
|
|
## removeEntity
|
|
|
|
Removes all options from the networked entities list with the option names.
|
|
|
|
```lua
|
|
exports.ox_target:removeEntity(netIds, optionNames)
|
|
```
|
|
|
|
- netIds: `number` or `number[]`
|
|
- optionNames: `string` or `string[]`
|
|
|
|
## addLocalEntity
|
|
|
|
Creates new targetable options for a specific entity handle or list of entity handles.
|
|
|
|
```lua
|
|
exports.ox_target:addLocalEntity(entities, options)
|
|
```
|
|
|
|
- entities: `number` or `number[]`
|
|
- options: `table`
|
|
|
|
## removeLocalEntity
|
|
|
|
Removes all options from the entities list with the option names.
|
|
|
|
```lua
|
|
exports.ox_target:removeLocalEntity(entities, optionNames)
|
|
```
|
|
|
|
- entities: `number` or `number[]`
|
|
- optionNames: `string` or `string[]`
|
|
|
|
## addSphereZone
|
|
|
|
Creates a new targetable [sphere zone](../../ox_lib/Modules/Zones/Shared#libzonessphere).
|
|
|
|
```lua
|
|
exports.ox_target:addSphereZone(parameters)
|
|
```
|
|
|
|
- parameters: `table`
|
|
- coords: `vector`
|
|
- radius?: `number`
|
|
- debug?: `boolean`
|
|
- drawSprite?: `boolean`
|
|
- options: `table`
|
|
|
|
Return:
|
|
- id: `number`
|
|
|
|
## addBoxZone
|
|
|
|
Creates a new targetable [box zone](../../ox_lib/Modules/Zones/Shared#libzonesbox).
|
|
|
|
```lua
|
|
exports.ox_target:addBoxZone(parameters)
|
|
```
|
|
|
|
- parameters: `table`
|
|
- coords: `vector`
|
|
- size?: `vector3`
|
|
- rotation?: `number`
|
|
- debug?: `boolean`
|
|
- drawSprite?: `boolean`
|
|
- options: `table`
|
|
|
|
Return:
|
|
- id: `number`
|
|
|
|
## addPolyZone
|
|
|
|
Creates a new targetable [poly zone](../../ox_lib/Modules/Zones/Shared#libzonespoly).
|
|
|
|
```lua
|
|
exports.ox_target:addPolyZone(parameters)
|
|
```
|
|
|
|
- parameters: `table`
|
|
- points: `vector3[]`
|
|
- All z values must match
|
|
- thickness?: `number`
|
|
- debug?: `boolean`
|
|
- drawSprite?: `boolean`
|
|
- options: `table`
|
|
|
|
Return:
|
|
- id: `number`
|
|
|
|
## removeZone
|
|
|
|
Removes a targetable zone with the given id (returned by addBoxZone/addSphereZone).
|
|
|
|
```lua
|
|
exports.ox_target:removeZone(id)
|
|
```
|
|
|
|
- id: `number` or `string`
|
|
- The `number` id that is returned by [addSphereZone](#addspherezone), [addBoxZone](#addboxzone), or [addPolyZone](#addpolyzone)
|
|
**OR**
|
|
- The `string` name that can be specified by the user
|