From d4c47d4459a2f705b8bd32763f862e1f3d1d3ea4 Mon Sep 17 00:00:00 2001 From: Space V <40030799+ahcenezdh@users.noreply.github.com> Date: Fri, 22 Dec 2023 00:10:31 +0100 Subject: [PATCH] feat(vehicles/genarea): update cargen area natives --- .../ClearVehicleGeneratorAreaOfInterest.md | 35 ++++++++++ VEHICLE/N_0x0a436b8643716d14.md | 14 ---- VEHICLE/N_0x9a75585fb2e54fad.md | 22 ------- VEHICLE/SetVehicleGeneratorAreaOfInterest.md | 64 +++++++++++++++++++ 4 files changed, 99 insertions(+), 36 deletions(-) create mode 100644 VEHICLE/ClearVehicleGeneratorAreaOfInterest.md delete mode 100644 VEHICLE/N_0x0a436b8643716d14.md delete mode 100644 VEHICLE/N_0x9a75585fb2e54fad.md create mode 100644 VEHICLE/SetVehicleGeneratorAreaOfInterest.md diff --git a/VEHICLE/ClearVehicleGeneratorAreaOfInterest.md b/VEHICLE/ClearVehicleGeneratorAreaOfInterest.md new file mode 100644 index 000000000..ed6e0010f --- /dev/null +++ b/VEHICLE/ClearVehicleGeneratorAreaOfInterest.md @@ -0,0 +1,35 @@ +--- +ns: VEHICLE +aliases: ["0x0A436B8643716D14"] +--- +## CLEAR_VEHICLE_GENERATOR_AREA_OF_INTEREST + +```c +// 0x0A436B8643716D14 0x6C73E45A +void CLEAR_VEHICLE_GENERATOR_AREA_OF_INTEREST(); +``` + +Removes the cargen area of interest and resumes normal cargen spawning. + +You can set the area of interest with [`SET_VEHICLE_GENERATOR_AREA_OF_INTEREST`](#_0x9A75585FB2E54FAD) + +## Return value +This native does not return any value. + +## Examples +```lua +-- This example clears the area of interest (cargen) and resumes normal spawning +ClearVehicleGeneratorAreaOfInterest() +``` + +```js +// This example clears the area of interest (cargen) and resumes normal spawning +ClearVehicleGeneratorAreaOfInterest(); +``` + +```cs +// This example clears the area of interest (cargen) and resumes normal spawning +using static CitizenFX.Core.Native.API; + +ClearVehicleGeneratorAreaOfInterest(); +``` \ No newline at end of file diff --git a/VEHICLE/N_0x0a436b8643716d14.md b/VEHICLE/N_0x0a436b8643716d14.md deleted file mode 100644 index 84b492c16..000000000 --- a/VEHICLE/N_0x0a436b8643716d14.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -ns: VEHICLE ---- -## _0x0A436B8643716D14 - -```c -// 0x0A436B8643716D14 0x6C73E45A -void _0x0A436B8643716D14(); -``` - -``` -CLEAR_VEHICLE_* -``` - diff --git a/VEHICLE/N_0x9a75585fb2e54fad.md b/VEHICLE/N_0x9a75585fb2e54fad.md deleted file mode 100644 index 84edb6b6c..000000000 --- a/VEHICLE/N_0x9a75585fb2e54fad.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -ns: VEHICLE ---- -## _0x9A75585FB2E54FAD - -```c -// 0x9A75585FB2E54FAD 0x935A95DA -void _0x9A75585FB2E54FAD(float x, float y, float z, float radius); -``` - -``` -Related to car generators & CPlayerSwitchMgrLong -SET_VEHICLE_* -SET_VEHICLE_GENERATORS_EXPECTED_GAMEPLAY_PT ? -``` - -## Parameters -* **x**: -* **y**: -* **z**: -* **radius**: - diff --git a/VEHICLE/SetVehicleGeneratorAreaOfInterest.md b/VEHICLE/SetVehicleGeneratorAreaOfInterest.md new file mode 100644 index 000000000..b86ce9b39 --- /dev/null +++ b/VEHICLE/SetVehicleGeneratorAreaOfInterest.md @@ -0,0 +1,64 @@ +--- +ns: VEHICLE +aliases: ["0x9A75585FB2E54FAD"] +--- +## SET_VEHICLE_GENERATOR_AREA_OF_INTEREST + +```c +// 0x9A75585FB2E54FAD 0x935A95DA +void SET_VEHICLE_GENERATOR_AREA_OF_INTEREST(float x, float y, float z, float radius); +``` + +Specifies an area of interest where cargens will focus on spawning vehicles + +You can clear the area of interest with [`CLEAR_VEHICLE_GENERATOR_AREA_OF_INTEREST`](#_0x0A436B8643716D14) + +## Parameters +* **x**: The X coordinate of the central point of the area of interest. +* **y**: The Y coordinate of the central point of the area of interest. +* **z**: The Z coordinate of the central point of the area of interest. +* **radius**: The radius around the central point, defining the size of the area of interest + +## Return value +This native does not return any value. + +## Examples +```lua +-- This example sets the area of interest (cargen) to the player's position with a radius of 100.0 + +-- Retrieve the player ped +local playerPed = PlayerPedId() + +-- Retrieve the coordinates of the player. +local coords = GetEntityCoords(playerPed, false) + +-- Set the area of interest to the player's position with a radius of 100.0 +SetVehicleGeneratorAreaOfInterest(coords.x, coords.y, coords.z, 100.0) +``` + +```js +// This example sets the area of interest (cargen) to the player's position with a radius of 100.0 + +// Retrieve the player ped +const playerPed = PlayerPedId(); + +// Retrieve the coordinates of the player. +const coords = GetEntityCoords(playerPed, false); + +// Set the area of interest to the player's position with a radius of 100.0 +SetVehicleGeneratorAreaOfInterest(coords.x, coords.y, coords.z, 100.0); +``` + +```cs +// This example sets the area of interest (cargen) to the player's position with a radius of 100.0 +using static CitizenFX.Core.Native.API; + +// Retrieve the player ped +Ped playerPed = PlayerPedId(); + +// Retrieve the coordinates of the player. +Vector3 coords = GetEntityCoords(playerPed, false); + +// Set the area of interest to the player's position with a radius of 100.0 +SetVehicleGeneratorAreaOfInterest(coords.X, coords.Y, coords.Z, 100f); +```