mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-03 14:38:49 +00:00
Merge branch 'lib-update' into main
This commit is contained in:
commit
ba0b798808
8 files changed
+147
-4
No files matched your search
@@ -0,0 +1,17 @@
|
|||||||
|
### lib.getClosestObject
|
||||||
|
|
||||||
|
Get the object handle and coords of the closest object to a set of coordinates.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
lib.getClosestObject(coords, maxDistance)
|
||||||
|
```
|
||||||
|
|
||||||
|
* coords: `vector3`
|
||||||
|
* The coords to check from.
|
||||||
|
* maxDistance: `number`
|
||||||
|
* The max distance to check.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
|
||||||
|
* ped?: `number`
|
||||||
|
* coords?: `number`
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
### lib.getClosestPed
|
||||||
|
|
||||||
|
Get the ped handle and coords of the closest ped to a set of coordinates.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
lib.getClosestPed(coords, maxDistance)
|
||||||
|
```
|
||||||
|
|
||||||
|
* coords: `vector3`
|
||||||
|
* The coords to check from.
|
||||||
|
* maxDistance: `number`
|
||||||
|
* The max distance to check.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
|
||||||
|
* ped?: `number`
|
||||||
|
* coords?: `number`
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
### lib.getNearbyObjects
|
||||||
|
|
||||||
|
Get the object handle and coords of all objects within range of a set of coordinates.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
lib.getNearbyObjects(coords, maxDistance)
|
||||||
|
```
|
||||||
|
|
||||||
|
* coords: `vector3`
|
||||||
|
* The coords to check from.
|
||||||
|
* maxDistance: `number`
|
||||||
|
* The max distance to check.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
|
||||||
|
* `{ object: number, coords: vector3 }[]`
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
### lib.getNearbyPeds
|
||||||
|
|
||||||
|
Get the ped handle and coords of all peds within range of a set of coordinates.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
lib.getNearbyPeds(coords, maxDistance)
|
||||||
|
```
|
||||||
|
|
||||||
|
* coords: `vector3`
|
||||||
|
* The coords to check from.
|
||||||
|
* maxDistance: `number`
|
||||||
|
* The max distance to check.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
|
||||||
|
* `{ ped: number, coords: vector3 }[]`
|
||||||
@@ -15,4 +15,4 @@ lib.getNearbyPlayers(coords, maxDistance, includePlayer)
|
|||||||
|
|
||||||
Return:
|
Return:
|
||||||
|
|
||||||
* `number[]`
|
* `{ id: number, ped: number, coords: vector3 }[]`
|
||||||
@@ -15,4 +15,4 @@ lib.getNearbyVehicles(coords, maxDistance, includePlayerVehicle)
|
|||||||
|
|
||||||
Return:
|
Return:
|
||||||
|
|
||||||
* `number[]`
|
* `{ vehicle: number, coords: vector3 }[]`
|
||||||
@@ -110,7 +110,10 @@ lib.notify({
|
|||||||
position = 'top',
|
position = 'top',
|
||||||
style = {
|
style = {
|
||||||
backgroundColor = '#141517',
|
backgroundColor = '#141517',
|
||||||
|
color = '#C1C2C5',
|
||||||
|
['.description'] = {
|
||||||
color = '#909296'
|
color = '#909296'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
icon = 'ban',
|
icon = 'ban',
|
||||||
iconColor = '#C53030'
|
iconColor = '#C53030'
|
||||||
@@ -130,7 +133,10 @@ lib.notify({
|
|||||||
position: 'top',
|
position: 'top',
|
||||||
style: {
|
style: {
|
||||||
backgroundColor: '#141517',
|
backgroundColor: '#141517',
|
||||||
color: '#909296'
|
color: '#C1C2C5',
|
||||||
|
'.decription': {
|
||||||
|
color: '#909296',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
icon: 'ban',
|
icon: 'ban',
|
||||||
iconColor: '#C53030'
|
iconColor: '#C53030'
|
||||||
@@ -140,4 +146,4 @@ lib.notify({
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||

|

|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
## lib.math
|
||||||
|
|
||||||
|
Extends the standard Lua math table with extra functions.
|
||||||
|
|
||||||
|
```
|
||||||
|
math = lib.math
|
||||||
|
```
|
||||||
|
|
||||||
|
### math.toscalars
|
||||||
|
|
||||||
|
Takes a string and returns a set of scalar values.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
math.toscalars(input, min, max, round)
|
||||||
|
```
|
||||||
|
|
||||||
|
- input: `string`
|
||||||
|
- min?: `number`
|
||||||
|
- max?: `number`
|
||||||
|
- round?: `boolean`
|
||||||
|
|
||||||
|
Return:
|
||||||
|
|
||||||
|
- ...: `number`
|
||||||
|
|
||||||
|
### math.tovector
|
||||||
|
|
||||||
|
Takes a string or table and returns a vector value, or a number if only one value was found.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
math.tovector(input, min, max, round)
|
||||||
|
```
|
||||||
|
|
||||||
|
- input: `string` or `table`
|
||||||
|
- min?: `number`
|
||||||
|
- max?: `number`
|
||||||
|
- round?: `boolean`
|
||||||
|
|
||||||
|
Return:
|
||||||
|
|
||||||
|
- value: `number` or `vector2` or `vector3` or `vector4`
|
||||||
|
|
||||||
|
### math.torgba
|
||||||
|
|
||||||
|
Takes a string or table and returns a vector value, or a number if only one value was found.
|
||||||
|
Values are rounded and must be within the range of 0-255.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
math.torgba(input)
|
||||||
|
```
|
||||||
|
|
||||||
|
- input: `string` or `table`
|
||||||
|
|
||||||
|
Return:
|
||||||
|
|
||||||
|
- value: `number` or `vector2` or `vector3` or `vector4`
|
||||||
|
|
||||||
|
### math.tohex
|
||||||
|
|
||||||
|
Takes a number or string and formats it as a hexadecimal string.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
math.tohex(n, upper)
|
||||||
|
```
|
||||||
|
|
||||||
|
- n: `number` or `string`
|
||||||
|
- upper?: `boolean`
|
||||||
|
|
||||||
|
Return:
|
||||||
|
|
||||||
|
- hex: `string`
|
||||||
Reference in new issue
Block a user