Skip to content

Commit

Permalink
feat(vehicles/genarea): update cargen area natives
Browse files Browse the repository at this point in the history
  • Loading branch information
spacevx committed Dec 27, 2023
1 parent 5d614f1 commit b982c18
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 36 deletions.
32 changes: 32 additions & 0 deletions VEHICLE/ClearVehicleGeneratorAreaOfInterest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
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)

## 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();
```
14 changes: 0 additions & 14 deletions VEHICLE/N_0x0a436b8643716d14.md

This file was deleted.

22 changes: 0 additions & 22 deletions VEHICLE/N_0x9a75585fb2e54fad.md

This file was deleted.

61 changes: 61 additions & 0 deletions VEHICLE/SetVehicleGeneratorAreaOfInterest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
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
## 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);
```

0 comments on commit b982c18

Please sign in to comment.