mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 22:22:46 +00:00
chore: target, fuel, and doorlock updates (#136)
* 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
This commit is contained in:
7 files changed
+96
-48
No files matched your search
@@ -9,15 +9,16 @@ These events are safe to trigger and handle in other scripts.
|
|||||||
Can be triggered to lock or unlock a door.
|
Can be triggered to lock or unlock a door.
|
||||||
|
|
||||||
```
|
```
|
||||||
TriggerEvent('ox_doorlock:setState', doorId, state)
|
TriggerEvent('ox_doorlock:setState', doorId, state, lockpick)
|
||||||
```
|
```
|
||||||
|
|
||||||
- doorId: `number`
|
- doorId: `number`
|
||||||
- state: `0` or `1`
|
- state: `0` or `1` or `boolean`
|
||||||
|
- lockpick: `boolean`
|
||||||
|
|
||||||
## Handlers
|
## Handlers
|
||||||
|
|
||||||
These events shouldn't be triggered by any other scripts.
|
These events **should not** be triggered by any other scripts.
|
||||||
|
|
||||||
### ox_doorlock:stateChanged
|
### ox_doorlock:stateChanged
|
||||||
|
|
||||||
@@ -29,5 +30,5 @@ AddEventHandler('ox_doorlock:stateChanged', function(source, doorId, state, used
|
|||||||
|
|
||||||
- source: `number` or `nil`
|
- source: `number` or `nil`
|
||||||
- doorId: `number`
|
- doorId: `number`
|
||||||
- state: `0` or `1`
|
- state: `boolean`
|
||||||
- usedItem: `string` or `false`
|
- usedItem: `string` or `false` or `nil`
|
||||||
@@ -8,15 +8,13 @@ Gets data for a door with the given id, matching the id for the database entry.
|
|||||||
exports.ox_doorlock:getDoor(id)
|
exports.ox_doorlock:getDoor(id)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Parameters
|
Gets data for a door with the given `id`, matching the id for the database entry.
|
||||||
|
|
||||||
- id: `number`
|
- id: `number`
|
||||||
|
|
||||||
### Returns
|
Return:
|
||||||
|
|
||||||
- `table`
|
- door: `table`
|
||||||
|
|
||||||
Gets data for a door with the given name, matching the name for the database entry.
|
|
||||||
|
|
||||||
## getDoorFromName
|
## getDoorFromName
|
||||||
|
|
||||||
@@ -24,10 +22,19 @@ Gets data for a door with the given name, matching the name for the database ent
|
|||||||
exports.ox_doorlock:getDoorFromName(name)
|
exports.ox_doorlock:getDoorFromName(name)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Parameters
|
Gets data for a door with the given `name`, matching the name for the database entry.
|
||||||
|
|
||||||
- name: `string`
|
- name: `string`
|
||||||
|
|
||||||
### Returns
|
Return:
|
||||||
|
|
||||||
- `table`
|
- door: `table`
|
||||||
|
|
||||||
|
## editDoor
|
||||||
|
|
||||||
|
```lua
|
||||||
|
exports.ox_doorlock:editDoor(id, data)
|
||||||
|
```
|
||||||
|
|
||||||
|
- id: `number`
|
||||||
|
- data: `table`
|
||||||
@@ -26,6 +26,8 @@ title: Door Settings
|
|||||||
- Door can be lockpicked when interacting with a targeting resource.
|
- Door can be lockpicked when interacting with a targeting resource.
|
||||||
- Hide UI
|
- Hide UI
|
||||||
- No indicators (i.e. icon, text) will display on the door.
|
- No indicators (i.e. icon, text) will display on the door.
|
||||||
|
- Hold Open
|
||||||
|
- Holds the door open while unlocked.
|
||||||
|
|
||||||
## Characters
|
## Characters
|
||||||
|
|
||||||
@@ -44,13 +46,24 @@ title: Door Settings
|
|||||||
- Item
|
- Item
|
||||||
- Name of the item.
|
- Name of the item.
|
||||||
- Metadata type
|
- Metadata type
|
||||||
- Requires metadata support (i.e. ox_inventory) to check slot.metadata.type
|
- Requires metadata support (i.e. ox_inventory) to check slot.metadata.type.
|
||||||
|
- Remove on use
|
||||||
|
- Removes the item after interacting with the door.
|
||||||
|
|
||||||
## Lockpick
|
## Lockpick
|
||||||
|
|
||||||
- Difficulty
|
- Difficulty
|
||||||
- Sets the skillcheck difficulty (see [docs](../ox_lib/Modules/Interface/Client/skillcheck)).
|
- Sets the skillcheck difficulty (see [docs](../ox_lib/Modules/Interface/Client/skillcheck)).
|
||||||
- Area size
|
- Area size
|
||||||
- Custom difficulty area size.
|
- Custom difficulty area size in degrees.
|
||||||
- Speed multiplier
|
- Speed multiplier
|
||||||
- Custom difficulty idicator speed.
|
- Custom difficulty idicator speed multipier.
|
||||||
|
|
||||||
|
## Sound
|
||||||
|
|
||||||
|
- Lock sound
|
||||||
|
- Sound to play on door lock.
|
||||||
|
- Unlock sound
|
||||||
|
- Sound to play on door unlock.
|
||||||
|
|
||||||
|
*Note*: Sounds are stored in the `./web/public/sounds` directory.
|
||||||
@@ -27,15 +27,3 @@ These resources aren't required but provide additional functionality.
|
|||||||
- [ox_target](../ox_target/)
|
- [ox_target](../ox_target/)
|
||||||
|
|
||||||
</Steps>
|
</Steps>
|
||||||
|
|
||||||
## Get vehicle fuel amount
|
|
||||||
|
|
||||||
```lua
|
|
||||||
local fuel = Entity(vehicleId).state.fuel
|
|
||||||
```
|
|
||||||
|
|
||||||
## Set vehicle fuel amount
|
|
||||||
|
|
||||||
```lua
|
|
||||||
Entity(vehicleId).state.fuel = fuelAmount
|
|
||||||
```
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
## Get vehicle fuel amount
|
||||||
|
|
||||||
|
```lua
|
||||||
|
local fuel = Entity(vehicleId).state.fuel
|
||||||
|
```
|
||||||
|
|
||||||
|
## Set vehicle fuel amount
|
||||||
|
|
||||||
|
```lua
|
||||||
|
Entity(vehicleId).state.fuel = fuelAmount
|
||||||
|
```
|
||||||
@@ -21,9 +21,9 @@ lib.zones.poly(data)
|
|||||||
- All z values must match
|
- All z values must match
|
||||||
- thickness?: `number`
|
- thickness?: `number`
|
||||||
- Default: `4`
|
- Default: `4`
|
||||||
- onEnter: `function(self: table)`
|
- onEnter?: `function(self: table)`
|
||||||
- onExit: `function(self: table)`
|
- onExit?: `function(self: table)`
|
||||||
- inside: `function(self: table)`
|
- inside?: `function(self: table)`
|
||||||
- debug?: `boolean`
|
- debug?: `boolean`
|
||||||
|
|
||||||
## lib.zones.box
|
## lib.zones.box
|
||||||
@@ -35,12 +35,13 @@ lib.zones.box(data)
|
|||||||
- data: `table`
|
- data: `table`
|
||||||
- coords: `vector3`
|
- coords: `vector3`
|
||||||
- size?: `vector3`
|
- size?: `vector3`
|
||||||
- Default: `vec3(4, 4, 4)`
|
- Default: `vec3(2, 2, 2)`
|
||||||
- rotation?: `number`
|
- rotation?: `number`
|
||||||
- Angle in degrees
|
- Angle in degrees
|
||||||
- onEnter: `function(self: table)`
|
- Default: `0`
|
||||||
- onExit: `function(self: table)`
|
- onEnter?: `function(self: table)`
|
||||||
- inside: `function(self: table)`
|
- onExit?: `function(self: table)`
|
||||||
|
- inside?: `function(self: table)`
|
||||||
- debug?: `boolean`
|
- debug?: `boolean`
|
||||||
|
|
||||||
## lib.zones.sphere
|
## lib.zones.sphere
|
||||||
@@ -53,9 +54,9 @@ lib.zones.sphere(data)
|
|||||||
- coords: `vector3`
|
- coords: `vector3`
|
||||||
- radius?: `number`
|
- radius?: `number`
|
||||||
- Default: `2`
|
- Default: `2`
|
||||||
- onEnter: `function`(self: `table`)
|
- onEnter?: `function(self: table)`
|
||||||
- onExit: `function`(self: `table`)
|
- onExit?: `function(self: table)`
|
||||||
- inside: `function`(self: `table`)
|
- inside?: `function(self: table)`
|
||||||
- debug?: `boolean`
|
- debug?: `boolean`
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ exports.ox_target:disableTargeting(state)
|
|||||||
```
|
```
|
||||||
|
|
||||||
- state: `boolean`
|
- 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
|
## addGlobalObject
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ exports.ox_target:addGlobalPlayer(options)
|
|||||||
|
|
||||||
## removeGlobalPlayer
|
## removeGlobalPlayer
|
||||||
|
|
||||||
Removes all options from the global Ped list with the option names.
|
Removes all options from the global Player list with the option names.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
exports.ox_target:removeGlobalPlayer(optionNames)
|
exports.ox_target:removeGlobalPlayer(optionNames)
|
||||||
@@ -100,7 +101,7 @@ Creates new targetable options for a specific model or list of models.
|
|||||||
exports.ox_target:addModel(models, options)
|
exports.ox_target:addModel(models, options)
|
||||||
```
|
```
|
||||||
|
|
||||||
- models: `number` or `number[]`
|
- models: `number` or `string` or `Array<number | string>`
|
||||||
- options: `table`
|
- options: `table`
|
||||||
|
|
||||||
## removeModel
|
## removeModel
|
||||||
@@ -111,12 +112,12 @@ Removes all options from the models list with the option names.
|
|||||||
exports.ox_target:removeModel(models, optionNames)
|
exports.ox_target:removeModel(models, optionNames)
|
||||||
```
|
```
|
||||||
|
|
||||||
- models: `number` or `number[]`
|
- models: `number` or `string` or `Array<number | string>`
|
||||||
- optionNames: `string` or `string[]`
|
- optionNames: `string` or `string[]`
|
||||||
|
|
||||||
## addEntity
|
## addEntity
|
||||||
|
|
||||||
Creates new targetable options for a specific network id (see [NetworkGetNetworkIdFromEntity](https://docs.fivem.net/natives/?_0x9E35DAB6)).
|
Creates new targetable options for a specific network id or list of network ids (see [NetworkGetNetworkIdFromEntity](https://docs.fivem.net/natives/?_0x9E35DAB6)).
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
exports.ox_target:addEntity(netIds, options)
|
exports.ox_target:addEntity(netIds, options)
|
||||||
@@ -138,7 +139,7 @@ exports.ox_target:removeEntity(netIds, optionNames)
|
|||||||
|
|
||||||
## addLocalEntity
|
## addLocalEntity
|
||||||
|
|
||||||
Creates new targetable options for a specific entity or list of entities.
|
Creates new targetable options for a specific entity handle or list of entity handles.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
exports.ox_target:addLocalEntity(entities, options)
|
exports.ox_target:addLocalEntity(entities, options)
|
||||||
@@ -168,12 +169,13 @@ exports.ox_target:addSphereZone(parameters)
|
|||||||
|
|
||||||
- parameters: `table`
|
- parameters: `table`
|
||||||
- coords: `vector`
|
- coords: `vector`
|
||||||
- radius: `number`
|
- radius?: `number`
|
||||||
- debug?: `boolean`
|
- debug?: `boolean`
|
||||||
- drawSprite?: `boolean`
|
- drawSprite?: `boolean`
|
||||||
- options: `table`
|
- options: `table`
|
||||||
|
|
||||||
**Returns:** `number`
|
Return:
|
||||||
|
- id: `number`
|
||||||
|
|
||||||
## addBoxZone
|
## addBoxZone
|
||||||
|
|
||||||
@@ -185,13 +187,33 @@ exports.ox_target:addBoxZone(parameters)
|
|||||||
|
|
||||||
- parameters: `table`
|
- parameters: `table`
|
||||||
- coords: `vector`
|
- coords: `vector`
|
||||||
- size: `vector3`
|
- size?: `vector3`
|
||||||
- rotation: `number`
|
- rotation?: `number`
|
||||||
- debug?: `boolean`
|
- debug?: `boolean`
|
||||||
- drawSprite?: `boolean`
|
- drawSprite?: `boolean`
|
||||||
- options: `table`
|
- options: `table`
|
||||||
|
|
||||||
**Returns:** `number`
|
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
|
## removeZone
|
||||||
|
|
||||||
@@ -200,3 +222,8 @@ Removes a targetable zone with the given id (returned by addBoxZone/addSphereZon
|
|||||||
```lua
|
```lua
|
||||||
exports.ox_target:removeZone(id)
|
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
|
||||||
Reference in new issue
Block a user