Skip to content

Commit e2a25db

Browse files
spacevx4mmonium
andauthored
feat(natives/vehicle): update no named natives (citizenfx#1067)
* feat(natives/vehicle): update no named natives * Update ARE_PLANE_CONTROL_PANELS_INTACT * Update SET_DISABLE_BMX_EXTRA_TRICK_FORCES * Update ArePlaneControlPanelsIntact.md Nitpick: Remove extra new line in js codeblock --------- Co-authored-by: ammonia-cfx <[email protected]>
1 parent db936d1 commit e2a25db

4 files changed

+146
-30
lines changed
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
ns: VEHICLE
3+
aliases: ["0xF78F94D60248C737"]
4+
---
5+
## ARE_PLANE_CONTROL_PANELS_INTACT
6+
7+
```c
8+
// 0xF78F94D60248C737 0x3B51B348
9+
BOOL ARE_PLANE_CONTROL_PANELS_INTACT(Vehicle vehicle, BOOL checkForZeroHealth);
10+
```
11+
12+
Queries whether the control panels of a plane are intact. This native is used to determine the operational status of a plane's cockpit controls, which can affect the plane's flyability.
13+
14+
## Parameters
15+
* **vehicle**: The vehicle to check. This should be a plane.
16+
* **checkForZeroHealth**: If set to `true`, the native also checks if the plane's health is zero, indicating it is completely destroyed. If `false`, only the state of the control panels is considered.
17+
18+
## Return value
19+
Returns `true` if the plane's control panels are intact, and, depending on the `checkForZeroHealth` parameter, the plane is not completely destroyed. Returns `false` if the control panels are damaged or the plane is destroyed (when `checkForZeroHealth` is `true`).
20+
21+
## Examples
22+
```lua
23+
-- Retrieve the player ped
24+
local playerPed = PlayerPedId()
25+
26+
-- Retrieve the plane the player is currently in.
27+
local plane = GetVehiclePedIsIn(playerPed, false)
28+
29+
-- If the player is not in a plane, return
30+
if (plane == 0) or (not IsThisModelAPlane(GetEntityModel(plane))) then return end
31+
32+
-- Check if the plane's control panels are intact
33+
local controlPanelsIntact = ArePlaneControlPanelsIntact(plane, true)
34+
35+
if (controlPanelsIntact) then
36+
print("The plane's control panels are intact")
37+
else
38+
print("The plane's control panels are damaged or the plane is destroyed")
39+
end
40+
```
41+
42+
```javascript
43+
// Retrieve the player ped
44+
const playerPed = PlayerPedId();
45+
46+
// Retrieve the plane the player is currently in.
47+
const plane = GetVehiclePedIsIn(playerPed, false);
48+
49+
// If the player is not in a plane, return
50+
if (plane === 0 || !IsThisModelAPlane(GetEntityModel(plane))) return;
51+
52+
// Check if the plane's control panels are intact
53+
const controlPanelsIntact = ArePlaneControlPanelsIntact(plane, true);
54+
55+
if (controlPanelsIntact) {
56+
console.log("The plane's control panels are intact");
57+
} else {
58+
console.log("The plane's control panels are damaged or the plane is destroyed");
59+
}
60+
```
61+
62+
```csharp
63+
using static CitizenFX.Core.Native.API;
64+
65+
// Retrieve the player ped
66+
Ped playerPed = PlayerPedId();
67+
68+
// Retrieve the plane the player is currently flying
69+
Vehicle plane = GetVehiclePedIsIn(playerPed, false);
70+
71+
// If the player is not flying a plane, return
72+
if (plane == 0 || !IsThisModelAPlane(GetEntityModel(plane))) return;
73+
74+
// Check if the plane's control panels are intact
75+
bool controlPanelsIntact = ArePlaneControlPanelsIntact(plane, true);
76+
77+
if (controlPanelsIntact) {
78+
Debug.WriteLine("The plane's control panels are intact");
79+
} else {
80+
Debug.WriteLine("The plane's control panels are damaged or the plane is destroyed");
81+
}
82+
```

VEHICLE/N_0x26d99d5a82fd18e8.md

-14
This file was deleted.

VEHICLE/N_0xf78f94d60248c737.md

-16
This file was deleted.
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
ns: VEHICLE
3+
aliases: ["0x26D99D5A82FD18E8"]
4+
---
5+
## SET_DISABLE_BMX_EXTRA_TRICK_FORCES
6+
7+
```c
8+
// 0x26D99D5A82FD18E8
9+
void SET_DISABLE_BMX_EXTRA_TRICK_FORCES(cs_type(Any) BOOL disableExtraTrickForces);
10+
```
11+
12+
Disables the additional physics forces applied to BMX bikes that enable them to perform tricks.
13+
14+
```
15+
NativeDB Introduced: v463
16+
```
17+
18+
## Parameters
19+
* **disableExtraTrickForces**: Set to `true` to disable the extra forces applied for tricks on BMX bicycles, making the bike behave more like a regular bicycle without trick capabilities. Set to `false` to allow BMX bikes to perform tricks normally.
20+
21+
## Examples
22+
```lua
23+
-- Retrieve the player ped
24+
local playerPed = PlayerPedId()
25+
26+
-- Retrieve the BMX bike the player is currently riding
27+
local bmx = GetVehiclePedIsIn(playerPed, false)
28+
29+
-- If the player is not riding a BMX bike, return
30+
if not IsThisModelABicycle(GetEntityModel(bmx)) then return end
31+
32+
-- Disable the extra forces applied to BMX bikes for tricks
33+
SetDisableBmxExtraTrickForces(bmx, true)
34+
```
35+
36+
```javascript
37+
// Retrieve the player ped
38+
const playerPed = PlayerPedId();
39+
40+
// Retrieve the BMX bike the player is currently riding
41+
const bmx = GetVehiclePedIsIn(playerPed, false);
42+
43+
// If the player is not riding a BMX bike, return
44+
if (!IsThisModelABicycle(GetEntityModel(bmx))) return;
45+
46+
// Disable the extra forces applied to BMX bikes for tricks
47+
SetDisableBmxExtraTrickForces(bmx, true);
48+
```
49+
50+
```csharp
51+
using static CitizenFX.Core.Native.API;
52+
53+
// Retrieve the player ped
54+
Ped playerPed = PlayerPedId();
55+
56+
// Retrieve the BMX bike the player is currently riding
57+
Vehicle bmx = GetVehiclePedIsIn(playerPed, false);
58+
59+
// If the player is not riding a BMX bike, return
60+
if (!IsThisModelABicycle(GetEntityModel(bmx))) return;
61+
62+
// Disable the extra forces applied to BMX bikes for tricks
63+
SetDisableBmxExtraTrickForces(bmx, true);
64+
```

0 commit comments

Comments
 (0)