Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vehicles/genarea): update cargen area natives #955

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
```
Loading