diff --git a/docs/ox_lib/GetClosestObject/Client.md b/docs/ox_lib/GetClosestObject/Client.md new file mode 100644 index 00000000..dc58d6d3 --- /dev/null +++ b/docs/ox_lib/GetClosestObject/Client.md @@ -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` diff --git a/docs/ox_lib/GetClosestPed/Client.md b/docs/ox_lib/GetClosestPed/Client.md new file mode 100644 index 00000000..3b6dc87d --- /dev/null +++ b/docs/ox_lib/GetClosestPed/Client.md @@ -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` diff --git a/docs/ox_lib/GetNearbyObjects/Client.md b/docs/ox_lib/GetNearbyObjects/Client.md new file mode 100644 index 00000000..0a7d5143 --- /dev/null +++ b/docs/ox_lib/GetNearbyObjects/Client.md @@ -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 }[]` diff --git a/docs/ox_lib/GetNearbyPeds/Client.md b/docs/ox_lib/GetNearbyPeds/Client.md new file mode 100644 index 00000000..52c0a2f4 --- /dev/null +++ b/docs/ox_lib/GetNearbyPeds/Client.md @@ -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 }[]` diff --git a/docs/ox_lib/GetNearbyPlayers/Client.md b/docs/ox_lib/GetNearbyPlayers/Client.md index 25674f31..5913a786 100644 --- a/docs/ox_lib/GetNearbyPlayers/Client.md +++ b/docs/ox_lib/GetNearbyPlayers/Client.md @@ -15,4 +15,4 @@ lib.getNearbyPlayers(coords, maxDistance, includePlayer) Return: -* `number[]` +* `{ id: number, ped: number, coords: vector3 }[]` diff --git a/docs/ox_lib/GetNearbyVehicles/Client.md b/docs/ox_lib/GetNearbyVehicles/Client.md index 7da79f13..75ac4f8b 100644 --- a/docs/ox_lib/GetNearbyVehicles/Client.md +++ b/docs/ox_lib/GetNearbyVehicles/Client.md @@ -15,4 +15,4 @@ lib.getNearbyVehicles(coords, maxDistance, includePlayerVehicle) Return: -* `number[]` +* `{ vehicle: number, coords: vector3 }[]` diff --git a/docs/ox_lib/Math/Shared.md b/docs/ox_lib/Math/Shared.md new file mode 100644 index 00000000..3040283b --- /dev/null +++ b/docs/ox_lib/Math/Shared.md @@ -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`