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(natives): expand example and update natives for enhanced functio… #934

Merged
merged 2 commits into from
Nov 22, 2023
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
49 changes: 48 additions & 1 deletion ENTITY/DeleteEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,54 @@ ns: ENTITY
void DELETE_ENTITY(Entity* entity);
```

Deletes the specified entity, and invalidates the passed handle (i.e. in/out argument).
Delete the specified entity, and invalidate the passed handle (i.e., the in/out argument).
You might want to check if the entity exists before with [DOES_ENTITY_EXIST](#_0x7239B21A38F536BA).

## Parameters
- **entity**: The entity to delete.

## Examples
```lua
-- Retrieve the vehicle the player is currently in.
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)

-- Check if the vehicle exists in the game world.
if not DoesEntityExist(vehicle) then
-- If the vehicle does not exist, end the execution of the code here.
return
end

-- If the vehicle does exist, delete the vehicle entity from the game world.
DeleteEntity(vehicle)
```

```js
// Retrieve the vehicle the player is currently in.
const vehicle = GetVehiclePedIsIn(PlayerPedId(), false);

// Check if the vehicle exists in the game world.
if (!DoesEntityExist(vehicle)) {
// If the vehicle does not exist, end the execution of the code here.
return;
}

// If the vehicle does exist, delete the vehicle entity from the game world.
DeleteEntity(vehicle);
```

```cs
using static CitizenFX.Core.Native.API;

// Retrieve the vehicle the player is currently in.
Vehicle vehicle = GetVehiclePedIsIn(PlayerPedId(), false);

// Check if the vehicle exists in the game world.
if (!DoesEntityExist(vehicle))
{
// If the vehicle does not exist, end the execution of the code here.
return;
}

// If the vehicle does exist, delete the vehicle entity from the game world.
DeleteEntity(vehicle);
```
29 changes: 29 additions & 0 deletions MISC/ClearWeatherTypeNowPersistNetwork.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
ns: MISC
aliases: ["0x0CF97F497FE7D048"]
---
## CLEAR_WEATHER_TYPE_NOW_PERSIST_NETWORK

```c
// 0x0CF97F497FE7D048
void CLEAR_WEATHER_TYPE_NOW_PERSIST_NETWORK(cs_type(float) int transitionTimeInMs);
```

Clears the active weather type after a specific amount of time determined by `transitionTimeInMs`.

## Parameters
* **transitionTimeInMs**: Transition time in milliseconds.

## Examples
```lua
RegisterCommand('weathertransition', function(source, args)
-- Set the weather type to foggy so we can see the change
SetWeatherTypeNowPersist("FOGGY")
-- Clear the weather and run the transition
local transitionTimeInMs = tonumber(args[1]) or 5000
if transitionTimeInMs > 0 then
ClearWeatherTypeNowPersistNetwork(transitionTimeInMs)
end
end, false)
```

20 changes: 0 additions & 20 deletions MISC/N_0x0cf97f497fe7d048.md

This file was deleted.

20 changes: 0 additions & 20 deletions VEHICLE/GetVehicleDoorDestroyType.md

This file was deleted.

19 changes: 19 additions & 0 deletions VEHICLE/GetVehicleIndividualDoorLockStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
ns: VEHICLE
aliases: ["0xCA4AC3EAAE46EC7B", "_GET_VEHICLE_DOOR_DESTROY_TYPE"]
---
## GET_VEHICLE_INDIVIDUAL_DOOR_LOCK_STATUS

```c
// 0xCA4AC3EAAE46EC7B
int GET_VEHICLE_INDIVIDUAL_DOOR_LOCK_STATUS(Vehicle vehicle, int doorIndex);
```

See eDoorId declared in [`SET_VEHICLE_DOOR_SHUT`](#_0x93D9BD300D7789E5)

## Parameters
* **vehicle**:
* **doorIndex**:

## Return value
Returns vehicle door lock state previously set with [`SET_VEHICLE_INDIVIDUAL_DOORS_LOCKED`](#_0xBE70724027F85BCD)
Loading