mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 06:28:54 +00:00
chore: oxmysql and ox_lib clean-up (#134)
* oxmysql and some lib interface fixes - Various fixes throughout oxmysql - started ox_lib audit * chore: More clean up - Reword some confusing descriptions - Add some descriptions - Type fixes - Spelling and grammar fixes - Swapping in `-` where `*` used to be for bullet point consistency ox_lib - Interface, ACL through GetClosestVehicle audited * chore: Finishing up ox_lib
This commit is contained in:
39 files changed
+533
-247
No files matched your search
@@ -6,12 +6,12 @@ Simple and centralised distance checking, supporting callbacks when entering, le
|
||||
Point<T>({coords, distance, onEnter, onExit, nearby, args})
|
||||
```
|
||||
|
||||
* coords: `number[]`
|
||||
* distance: `number`
|
||||
* onEnter?: `function`
|
||||
* onExit?: `function`
|
||||
* nearby?: `function`
|
||||
* args?: `T`
|
||||
- coords: `number[]`
|
||||
- distance: `number`
|
||||
- onEnter?: `function`
|
||||
- onExit?: `function`
|
||||
- nearby?: `function`
|
||||
- args?: `T`
|
||||
|
||||
```ts
|
||||
import { Point, cache } from '@overextended/ox_lib/client'
|
||||
@@ -43,4 +43,3 @@ point.onExit = () => {
|
||||
console.log('Left range of point', point.id)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,17 +4,23 @@ Simple and centralised distance checking, supporting callbacks when entering, le
|
||||
|
||||
### CPoint
|
||||
|
||||
A table representing a point, with the following properties.
|
||||
A table representing a point with the following properties.
|
||||
|
||||
* id: `number`
|
||||
* coords: `vector3`
|
||||
* distance: `number`
|
||||
* The distance for the player to be "inside" a point (i.e. the point's radius).
|
||||
* currentDistance: `number`
|
||||
* The players current distance from the centre of the point.
|
||||
* isClosest?: `boolean`
|
||||
* remove: `function()`
|
||||
* Removes the point from the points registry.
|
||||
- id: `number`
|
||||
- coords: `vector3`
|
||||
- distance: `number`
|
||||
- The distance for the player to be "inside" a point (i.e. the point's radius).
|
||||
- currentDistance: `number`
|
||||
- The players current distance from the centre of the point.
|
||||
- isClosest?: `boolean`
|
||||
- remove: `function()`
|
||||
- Removes the point from the points registry.
|
||||
- onEnter?: `function(self: CPoint)`
|
||||
- Function triggered when player gets within `distance` of the point
|
||||
- onExit?: `function(self: CPoint)`
|
||||
- Function triggered when player goes beyond `distance` of the point
|
||||
- nearby?: `function(self: CPoint)`
|
||||
- Function triggered on frame when within `distance` of the point
|
||||
|
||||
### lib.points.new
|
||||
|
||||
@@ -22,12 +28,15 @@ A table representing a point, with the following properties.
|
||||
lib.points.new(data)
|
||||
```
|
||||
|
||||
* data: `table`
|
||||
* coords: `vector3`
|
||||
* distance: `number`
|
||||
- data: `table`
|
||||
- coords: `vector3`
|
||||
- distance: `number`
|
||||
|
||||
**Returns:** CPoint
|
||||
Returns:
|
||||
|
||||
- point: `CPoint`
|
||||
|
||||
#### Example
|
||||
```lua
|
||||
local point = lib.points.new({
|
||||
coords = GetEntityCoords(cache.ped),
|
||||
@@ -60,7 +69,9 @@ Get a table of all points created in the resource.
|
||||
lib.points.getAllPoints()
|
||||
```
|
||||
|
||||
**Return:** `table<number, CPoint>`
|
||||
Return:
|
||||
|
||||
- points: `CPoint[]`
|
||||
|
||||
### lib.points.getNearbyPoints
|
||||
|
||||
@@ -70,7 +81,9 @@ Get an array of all points in range of the player.
|
||||
lib.points.getNearbyPoints()
|
||||
```
|
||||
|
||||
**Return:** `CPoint[]`
|
||||
Return:
|
||||
|
||||
- nearbyPoints: `CPoint[]`
|
||||
|
||||
### lib.points.getClosestPoint
|
||||
|
||||
@@ -80,4 +93,6 @@ Get the data for the closest point to the player.
|
||||
lib.points.getClosestPoint()
|
||||
```
|
||||
|
||||
**Returns:** `CPoint`
|
||||
Return:
|
||||
|
||||
- closestPoint?: `CPoint`
|
||||
Reference in new issue
Block a user