Skip to content

Commit b902a45

Browse files
Support 3407 natives (#1234)
* feat(natives/3407): support 3407 natives All credit goes to @gottfriedleibniz, @alloc8or and @fingaweg for finding those natives. Co-Authored-By: Dillon Skaggs <dillskaggs@gmail.com> * tweak: fix code example --------- Co-authored-by: Dillon Skaggs <dillskaggs@gmail.com>
1 parent 2e30b61 commit b902a45

23 files changed

+438
-4
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
ns: ENTITY
3+
---
4+
## _SET_ENTITY_NO_COLLISION_WITH_NETWORKED_ENTITY
5+
6+
```c
7+
// 0x0A27A7827347B3B1
8+
void _SET_ENTITY_NO_COLLISION_WITH_NETWORKED_ENTITY(Entity entity1, Entity entity2);
9+
```
10+
11+
```
12+
NativeDB Introduced: v3407
13+
```
14+
15+
16+
## Parameters
17+
* **entity1**:
18+
* **entity2**:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
ns: GRAPHICS
3+
---
4+
## _HAS_SCALEFORM_MOVIE_NAMED_LOADED
5+
6+
```c
7+
// 0x9743BCCF7CD6E1F6
8+
BOOL _HAS_SCALEFORM_MOVIE_NAMED_LOADED(int* scaleformHandle, char* scaleformName);
9+
```
10+
11+
Check if a Scaleform movie with the given name has been loaded.
12+
13+
```
14+
NativeDB Introduced: v3407
15+
```
16+
17+
## Parameters
18+
* **scaleformHandle**: Scaleform movie handle
19+
* **scaleformName**: Name of the Scaleform movie to check
20+
21+
22+
## Return value
23+
Returns `true` if the named Scaleform movie is loaded, `false` otherwise.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
ns: HUD
3+
---
4+
## _SHOW_PURCHASE_INSTRUCTIONAL_BUTTON
5+
6+
```c
7+
// 0xF6865E26067B708C
8+
void _SHOW_PURCHASE_INSTRUCTIONAL_BUTTON(BOOL toggle);
9+
```
10+
11+
```
12+
NativeDB Introduced: v3407
13+
```
14+
15+
16+
## Parameters
17+
* **toggle**:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
ns: PED
3+
---
4+
## IS_PED_IN_SPHERE_AREA_OF_ANY_ENEMY_PEDS
5+
6+
```c
7+
// 0x082D79E15302F0C2
8+
BOOL IS_PED_IN_SPHERE_AREA_OF_ANY_ENEMY_PEDS(Ped ped, float x, float y, float z, float range);
9+
```
10+
11+
```
12+
NativeDB Introduced: v3407
13+
```
14+
15+
## Parameters
16+
* **ped**: The ped to check.
17+
* **x**: X coordinate
18+
* **y**: Y coordinate
19+
* **z**: Z coordinate
20+
* **range**: Radius of sphere.
21+
22+
## Return value
23+
Returns `true` if ped is within range of any enemies, `false` otherwise.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
ns: PED
3+
---
4+
## _SET_PED_SURVIVES_BEING_OUT_OF_WATER
5+
6+
```c
7+
// 0x100CD221F572F6E1
8+
BOOL _SET_PED_SURVIVES_BEING_OUT_OF_WATER(Ped ped, BOOL toggle);
9+
```
10+
11+
Allows marine animals to survive outside of water (R* is using it for sharks).
12+
13+
```
14+
NativeDB Introduced: v3407
15+
```
16+
17+
## Parameters
18+
* **ped**: The marine animal ped
19+
* **toggle**: `true` to allow survival out of water, `false` to apply normal water restrictions.
20+
21+
## Return value
22+
Returns `true` if successful.

PHYSICS/GetDamping.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
ns: PHYSICS
3+
---
4+
## GET_DAMPING
5+
6+
```c
7+
// 0x8C520A929415BCD2
8+
Vector3 GET_DAMPING(Entity entity, int type);
9+
```
10+
11+
```
12+
NativeDB Introduced: v3407
13+
```
14+
15+
## Parameters
16+
* **entity**:
17+
* **type**:
18+
19+
## Return value
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
ns: TASK
3+
---
4+
## CLEAR_PED_SCRIPT_TASK_IF_RUNNING_THREAT_RESPONSE_NON_TEMP_TASK
5+
6+
```c
7+
// 0xF6DC48E56BE1243A
8+
void CLEAR_PED_SCRIPT_TASK_IF_RUNNING_THREAT_RESPONSE_NON_TEMP_TASK(Ped ped);
9+
```
10+
11+
```
12+
NativeDB Introduced: v3407
13+
```
14+
15+
16+
## Parameters
17+
* **ped**:

TASK/TaskSharkCircleCoord.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
ns: TASK
3+
---
4+
## TASK_SHARK_CIRCLE_COORD
5+
6+
```c
7+
// 0x60A19CF85FF4CEFA
8+
void TASK_SHARK_CIRCLE_COORD(Ped ped, float x, float y, float z, float moveBlendRatio, float radius);
9+
```
10+
11+
Makes a shark ped circle around specified coordinates.
12+
13+
```
14+
NativeDB Introduced: v3407
15+
```
16+
17+
## Parameters
18+
* **ped**: The shark ped.
19+
* **x**: X coordinate to circle around
20+
* **y**: Y coordinate to circle around
21+
* **z**: Z coordinate to circle around
22+
* **moveBlendRatio**: Animation blend ratio from 0.0 to 1.0
23+
* **radius**: Radius of the circular path in meters
24+
25+
## Examples
26+
```lua
27+
CreateThread(function()
28+
local sharkModel = GetHashKey("a_c_sharktiger")
29+
RequestModel(sharkModel)
30+
31+
while not HasModelLoaded(sharkModel) do
32+
Wait(0)
33+
end
34+
35+
local coords = GetEntityCoords(PlayerPedId(), false)
36+
local shark = CreatePed(28, sharkModel, coords.x, coords.y, coords.z, 0.0, true, true)
37+
38+
SetModelAsNoLongerNeeded(sharkModel)
39+
40+
if shark == 0 then return end
41+
42+
TaskSharkCircleCoord(shark, coords.x, coords.y, coords.z - 5.0, 1.0, 10.0)
43+
44+
Wait(10000) -- We're letting the shark do circle movement for 10 seconds
45+
ClearPedTasks(shark) -- Going to stop the task
46+
end)
47+
```

VEHICLE/DisableIndividualPlanePropeller.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ aliases: ["0x500873A45724C863","_DISABLE_PLANE_PROPELLER"]
99
void DISABLE_INDIVIDUAL_PLANE_PROPELLER(Vehicle vehicle, int propeller);
1010
```
1111
12+
```
13+
NativeDB Introduced: v323
14+
```
15+
1216
## Parameters
13-
* **vehicle**:
14-
* **propeller**:
17+
* **vehicle**: The propeller plane
18+
* **propeller**: The propeller index to disable (starts at 0).
1519
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
ns: VEHICLE
3+
---
4+
## _ENABLE_INDIVIDUAL_PLANE_PROPELLER
5+
6+
```c
7+
// 0xDC05D2777F855F44
8+
void _ENABLE_INDIVIDUAL_PLANE_PROPELLER(Vehicle plane, int propeller);
9+
```
10+
11+
Enables individual propeller on a propeller plane. This native is the inverse of [`DISABLE_INDIVIDUAL_PLANE_PROPELLER`](#_0x500873A45724C863).
12+
13+
```
14+
NativeDB Introduced: v3407
15+
```
16+
17+
## Parameters
18+
* **plane**: The propeller plane.
19+
* **propeller**: The propeller index to enable (starts at 0).
20+
21+
## Examples
22+
```lua
23+
CreateThread(function()
24+
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) -- The plane used in this example is the cuban800
25+
26+
DisableIndividualPlanePropeller(vehicle, 0)
27+
DisableIndividualPlanePropeller(vehicle, 1)
28+
-- We are disabling both propellers so we can start a specific one (since both are automatically started when entering the plane)
29+
Wait(5000) -- We are waiting 5 seconds
30+
EnableIndividualPlanePropeller(vehicle, 1) -- Starting the second propeller (since the index starts at 0)
31+
end)
32+
```

0 commit comments

Comments
 (0)