Skip to content

Commit

Permalink
feat(natives/3407): support 3407 natives
Browse files Browse the repository at this point in the history
All credit goes to @gottfriedleibniz, @alloc8or and @fingaweg for finding those natives.
  • Loading branch information
spacevx committed Dec 24, 2024
1 parent 3e7c8f0 commit cb8a2e6
Show file tree
Hide file tree
Showing 23 changed files with 440 additions and 4 deletions.
18 changes: 18 additions & 0 deletions ENTITY/SetEntityNoCollisionWithNetworkedEntity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
ns: ENTITY
---
## _SET_ENTITY_NO_COLLISION_WITH_NETWORKED_ENTITY

```c
// 0x0A27A7827347B3B1
void _SET_ENTITY_NO_COLLISION_WITH_NETWORKED_ENTITY(Entity entity1, Entity entity2);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **entity1**:
* **entity2**:
23 changes: 23 additions & 0 deletions GRAPHICS/HasScaleformMovieNamedLoaded.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
ns: GRAPHICS
---
## _HAS_SCALEFORM_MOVIE_NAMED_LOADED

```c
// 0x9743BCCF7CD6E1F6
BOOL _HAS_SCALEFORM_MOVIE_NAMED_LOADED(int* scaleformHandle, char* scaleformName);
```
Check if a Scaleform movie with the given name has been loaded.
```
NativeDB Introduced: v3407
```
## Parameters
* **scaleformHandle**: Scaleform movie handle
* **scaleformName**: Name of the Scaleform movie to check
## Return value
`true` if the named Scaleform movie is loaded, `false` otherwise.
17 changes: 17 additions & 0 deletions HUD/ShowPurchaseInstructionalButton.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
ns: HUD
---
## _SHOW_PURCHASE_INSTRUCTIONAL_BUTTON

```c
// 0xF6865E26067B708C
void _SHOW_PURCHASE_INSTRUCTIONAL_BUTTON(BOOL toggle);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **toggle**:
23 changes: 23 additions & 0 deletions PED/IsPedInSphereAreaOfAnyEnemyPeds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
ns: PED
---
## IS_PED_IN_SPHERE_AREA_OF_ANY_ENEMY_PEDS

```c
// 0x082D79E15302F0C2
BOOL IS_PED_IN_SPHERE_AREA_OF_ANY_ENEMY_PEDS(Ped ped, float x, float y, float z, float range);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **ped**: The ped to check.
* **x**: X coordinate
* **y**: Y coordinate
* **z**: Z coordinate
* **range**: Radius of sphere.
## Return value
Returns `true` if ped is within range of any enemies, `false` otherwise.
22 changes: 22 additions & 0 deletions PED/SetPedSurvivesBeingOutOfWater.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
ns: PED
---
## _SET_PED_SURVIVES_BEING_OUT_OF_WATER

```c
// 0x100CD221F572F6E1
BOOL _SET_PED_SURVIVES_BEING_OUT_OF_WATER(Ped ped, BOOL toggle);
```
Allows marine animals to survive outside of water (R* is using it for sharks).
```
NativeDB Introduced: v3407
```
## Parameters
* **ped**: The marine animal ped
* **toggle**: `true` to allow survival out of water, `false` to apply normal water restrictions.
## Return value
Returns `true` if successful.
19 changes: 19 additions & 0 deletions PHYSICS/GetDamping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
ns: PHYSICS
---
## GET_DAMPING

```c
// 0x8C520A929415BCD2
Vector3 GET_DAMPING(Entity entity, int type);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **entity**:
* **type**:
## Return value
17 changes: 17 additions & 0 deletions TASK/ClearPedScriptTaskIfRunningThreatResponseNonTempTask.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
ns: TASK
---
## CLEAR_PED_SCRIPT_TASK_IF_RUNNING_THREAT_RESPONSE_NON_TEMP_TASK

```c
// 0xF6DC48E56BE1243A
void CLEAR_PED_SCRIPT_TASK_IF_RUNNING_THREAT_RESPONSE_NON_TEMP_TASK(Ped ped);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **ped**:
50 changes: 50 additions & 0 deletions TASK/TaskSharkCircleCoord.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
ns: TASK
---
## TASK_SHARK_CIRCLE_COORD

```c
// 0x60A19CF85FF4CEFA
void TASK_SHARK_CIRCLE_COORD(Ped ped, float x, float y, float z, float moveBlendRatio, float radius);
```
Makes a shark ped circle around specified coordinates.
```
NativeDB Introduced: v3407
```
## Parameters
* **ped**: The shark ped.
* **x**: X coordinate to circle around
* **y**: Y coordinate to circle around
* **z**: Z coordinate to circle around
* **moveBlendRatio**: Animation blend ratio from 0.0 to 1.0
* **radius**: Radius of the circular path in meters
## Examples
```lua
local function CreateShark(coords)
RequestModel(sharkModel)
while not HasModelLoaded(sharkModel) do
Wait(0)
end
shark = CreatePed(28, sharkModel, coords.x, coords.y, coords.z, 0.0, true, true)
SetModelAsNoLongerNeeded(sharkModel)
return shark
end
local function SharkCircle(sharkHandle, coords)
if (DoesEntityExist(shark)) then
TaskSharkCircleCoord(sharkHandle, coords.x, coords.y, coords.z - 5.0, 1.0, 10.0)
Wait(10000) -- We're letting the shark doing circles movement for 10 seconds
ClearPedTasks(shark) -- Going to shop the task
end
end
local coords = GetEntityCoords(PlayerPedId())
local shark = CreateShark(coords)
SharkCircle(shark, coords)
```

8 changes: 6 additions & 2 deletions VEHICLE/DisableIndividualPlanePropeller.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ aliases: ["0x500873A45724C863","_DISABLE_PLANE_PROPELLER"]
void DISABLE_INDIVIDUAL_PLANE_PROPELLER(Vehicle vehicle, int propeller);
```
```
NativeDB Introduced: v323
```
## Parameters
* **vehicle**:
* **propeller**:
* **vehicle**: The propeller plane
* **propeller**: The propeller index to disable (starts at 0).
32 changes: 32 additions & 0 deletions VEHICLE/EnableIndividualPlanePropeller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
ns: VEHICLE
---
## _ENABLE_INDIVIDUAL_PLANE_PROPELLER

```c
// 0xDC05D2777F855F44
void _ENABLE_INDIVIDUAL_PLANE_PROPELLER(Vehicle plane, int propeller);
```
Enables individual propeller on a propeller plane. This native is the inverse of [`DISABLE_INDIVIDUAL_PLANE_PROPELLER`](#_0x500873A45724C863).
```
NativeDB Introduced: v3407
```
## Parameters
* **vehicle**: The propeller plane.
* **propeller**: The propeller index to enable (starts at 0).
## Examples
```lua
RegisterCommand("start", function()
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) -- The plane used in this example is the cuban800
DisableIndividualPlanePropeller(vehicle, 0)
DisableIndividualPlanePropeller(vehicle, 1)
-- We are disabling both propellers so we can start a specific one (since both are automatically started when entering the plane)
Wait(5000) -- We are waiting 5 seconds
EnableIndividualPlanePropeller(vehicle, 1) -- Starting the second propeller (since the index starts at 0)
end, false)
```
19 changes: 19 additions & 0 deletions VEHICLE/IsVehicleOnBoostPad.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
ns: VEHICLE
---
## _IS_VEHICLE_ON_BOOST_PAD

```c
// 0xFC40CBF7B90CA77C
BOOL _IS_VEHICLE_ON_BOOST_PAD(Vehicle vehicle);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **vehicle**: The vehicle to check.
## Return value
Return `true` if the vehicle is on a boost pad, `false` otherwise.
2 changes: 1 addition & 1 deletion VEHICLE/SetDisableExplodeFromBodyDamageOnCollision.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ aliases: ["0x26E13D440E7F6064"]
void SET_DISABLE_EXPLODE_FROM_BODY_DAMAGE_ON_COLLISION(Vehicle vehicle, cs_type(float) BOOL disableExplode);
```
Prevents a vehicle from exploding upon sustaining body damage from physical collisions. This can be used to increase the durability of vehicles in high-impact scenarios, such as races or combat situations, by preventing them from being destroyed due to collision-induced body damage.
Prevents a vehicle from exploding upon sustaining body damage from physical collisions. Only works for planes.
For helicopters, you might want to check [`SET_DISABLE_HELI_EXPLODE_FROM_BODY_DAMAGE`](#_0xEDBC8405B3895CC9) instead.
Expand Down
22 changes: 22 additions & 0 deletions VEHICLE/SetDisableExplodeFromBodyDamageReceivedByAiVehicle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
ns: VEHICLE
---
## _SET_DISABLE_EXPLODE_FROM_BODY_DAMAGE_RECEIVED_BY_AI_VEHICLE

```c
// 0xB0B7DF5CB876FF5E
void _SET_DISABLE_EXPLODE_FROM_BODY_DAMAGE_RECEIVED_BY_AI_VEHICLE(Vehicle plane, BOOL disable);
```
```
NativeDB Introduced: v3407
```
Prevents the plane from exploding when taking body damage if the inflictor is an AI-controlled vehicle. Only works for planes.
## Parameters
* **plane**:
* **disable**:
## Return value
Does not actually return anything.
2 changes: 1 addition & 1 deletion VEHICLE/SetDisableHeliExplodeFromBodyDamage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ aliases: ["0xEDBC8405B3895CC9"]
void SET_DISABLE_HELI_EXPLODE_FROM_BODY_DAMAGE(Vehicle helicopter, cs_type(Any) BOOL disableExplode);
```
Prevents a helicopter from exploding due to relatively minor body damage.
Prevents a helicopter from exploding due to relatively minor body damage. (Only works for helicopters and planes)
```
NativeDB Introduced: v1103
Expand Down
18 changes: 18 additions & 0 deletions VEHICLE/SetPlaneAvoidsOther.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
ns: VEHICLE
---
## _SET_PLANE_AVOIDS_OTHERS

```c
// 0xFC40CBF7B90CA77C
void _SET_PLANE_AVOIDS_OTHERS(Vehicle plane, BOOL toggle);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **plane**:
* **toggle**:
17 changes: 17 additions & 0 deletions VEHICLE/SetPlaneControlSectionsShouldBreakOffFromExplosions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
ns: VEHICLE
---
## SET_PLANE_CONTROL_SECTIONS_SHOULD_BREAK_OFF_FROM_EXPLOSIONS

```c
// 0xDD8A2D3337F04196
void SET_PLANE_CONTROL_SECTIONS_SHOULD_BREAK_OFF_FROM_EXPLOSIONS(Vehicle plane, BOOL toggle);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **vehicle**:
* **toggle**:
20 changes: 20 additions & 0 deletions VEHICLE/SetVehicleExplosiveDamageScale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
ns: VEHICLE
---
## _SET_VEHICLE_EXPLOSIVE_DAMAGE_SCALE

```c
// 0x84D7FFD223CAAFFD
Any _SET_VEHICLE_EXPLOSIVE_DAMAGE_SCALE(Vehicle vehicle, float scale);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **vehicle**:
* **scale**:
## Return value
Does not actually return anything.
19 changes: 19 additions & 0 deletions WEAPON/GetAmmoInVehicleWeaponClip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
ns: WEAPON
---
## _GET_AMMO_IN_VEHICLE_WEAPON_CLIP

```c
// 0x2857938C5D407AFA
BOOL _GET_AMMO_IN_VEHICLE_WEAPON_CLIP(Vehicle vehicle, int seat, int ammo);
```
```
NativeDB Introduced: v3407
```
## Parameters
* **vehicle**:
* **seat**:
* **ammo**:
Loading

0 comments on commit cb8a2e6

Please sign in to comment.