Skip to content

Commit

Permalink
feat(natives/3258): add new natives for the 3258 gamebuild (#1139)
Browse files Browse the repository at this point in the history
* feat(natives/3258): add new natives for the 3258 gamebuild

Add new natives from the last gamebuild, all credits goes to alloc8or

Some descriptions are guessed (InterpolateCamWithParams , SetBlockAmbientPedsFromDroppingWeaponsThisFrame, GetCutscenePlayTime)

* Fix enum being cpp instead of c

---------

Co-authored-by: Dillon Skaggs <[email protected]>
  • Loading branch information
spacevx and AvarianKnight authored Aug 7, 2024
1 parent 25b9fe0 commit af1349a
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 0 deletions.
20 changes: 20 additions & 0 deletions AUDIO/ForceVehicleEngineSynth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
ns: AUDIO
---
## _FORCE_VEHICLE_ENGINE_SYNTH

```c
// 0xEB7D0E1FCC8FE17A
void _FORCE_VEHICLE_ENGINE_SYNTH(Vehicle vehicle, BOOL force);
```
This native is used alongside with [`SET_VEHICLE_TYRE_BURST`](#_0xEC6A202EE4960385).
```
NativeDB Introduced: v3258
```
## Parameters
* **vehicle**:
* **force**:
21 changes: 21 additions & 0 deletions CAM/ActivateCamWithInterpAndFovCurve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
ns: CAM
---
## _ACTIVATE_CAM_WITH_INTERP_AND_FOV_CURVE

```c
// 0x34CFC4C2A38E83E3
void _ACTIVATE_CAM_WITH_INTERP_AND_FOV_CURVE(Cam camTo, Cam camFrom, int duration, int easeLocation, int easeRotation, int easeFove);
```
```
NativeDB Introduced: v3258
```
## Parameters
* **camTo**:
* **camFrom**:
* **duration**:
* **easeLocation**:
* **easeRotation**:
* **easeFove**:
30 changes: 30 additions & 0 deletions CAM/InterpolateCamWithParams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
ns: CAM
---
## _INTERPOLATE_CAM_WITH_PARAMS

```c
// 0xDDA77EE33C005AAF
void _INTERPOLATE_CAM_WITH_PARAMS(Cam camera, float camPosX, float camPosY, float camPosZ, float camRotX,float camRotY, float camRotZ, float fov, int duration, int posCurveType, int rotCurveType, int rotOrder, int fovCurveType);
```
Interpolates the camera to specified parameters over a set duration using various curve types for position, rotation, and fov.
```
NativeDB Introduced: v3258
```
## Parameters
* **camera**:
* **camPosX**:
* **camPosY**:
* **camPosZ**:
* **camRotX**:
* **camRotY**:
* **camRotZ**:
* **fov**:
* **duration**:
* **posCurveType**:
* **rotCurveType**:
* **rotOrder**:
* **fovCurveType**:
18 changes: 18 additions & 0 deletions CUTSCENE/GetCutscenePlayTime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
ns: CUTSCENE
---
## GET_CUTSCENE_PLAY_TIME

```c
// 0x710286BC5EF4D6E1
int GET_CUTSCENE_PLAY_TIME();
```

Gets the current time of the cutscene.

```
NativeDB Introduced: v3258
```

## Return value
Returns the current play time of the cutscene in milliseconds.
19 changes: 19 additions & 0 deletions OBJECT/SetObjectTargettableByPlayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
ns: OBJECT
---

```c
// 0xB39F03368DB0CAA2
void _SET_OBJECT_TARGETTABLE_BY_PLAYER(Object object, BOOL setFlag34, BOOL setFlag35);
```
Sets the 34th and 35th object flags related to player peds.
```
NativeDB Introduced: v3258
```
## Parameters
* **object**:
* **setFlag34**:
* **setFlag35**:
15 changes: 15 additions & 0 deletions PED/SetBlockAmbientPedsFromDroppingWeaponsThisFrame.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
ns: PED
---
## _SET_BLOCK_AMBIENT_PEDS_FROM_DROPPING_WEAPONS_THIS_FRAME

```c
// 0xC73EFFC5E043A8BA
void _SET_BLOCK_AMBIENT_PEDS_FROM_DROPPING_WEAPONS_THIS_FRAME();
```

Prevents ambient peds from dropping their weapons for the current frame.

```
NativeDB Introduced: v3258
```
34 changes: 34 additions & 0 deletions VEHICLE/GetIsVehicleElectric.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
ns: VEHICLE
---
## _GET_IS_VEHICLE_ELECTRIC

```c
// 0x1FCB07FE230B6639
BOOL _GET_IS_VEHICLE_ELECTRIC(Hash vehicleModel);
```
Checks if the vehicle is electric.
```
NativeDB Introduced: v3258
```
## Parameters
* **vehicleModel**: The hash of the vehicle model to check.
## Return value
Returns `true` if the vehicle is electric or `false` otherwise.
## Examples
```lua
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
-- GetVehiclePedIsIn will return 0 if the ped isn't currently in a vehicle
if veh == 0 then return end
local model = GetEntityModel(veh)
if (GetIsVehicleElectric(model)) then
print("This vehicle is electric")
else
print("This vehicle is not electric")
end
```
60 changes: 60 additions & 0 deletions VEHICLE/GetVehicleDriveTrainType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
ns: VEHICLE
---
## _GET_VEHICLE_DRIVETRAIN_TYPE

```c
// 0x1423725069EE1D14
int _GET_VEHICLE_DRIVETRAIN_TYPE(Hash vehicleModel);
```
```
NativeDB Introduced: v3258
```
**Note**: When using this native, the hash of the vehicle needs to be loaded into the client's memory. This can be done by requesting the model with [`REQUEST_MODEL`](#_0x963D27A58DF860AC) or by simply having the vehicle spawned.
```c
enum eVehicleDrivetrainType
{
VehicleDrivetrainType_INVALID = 0,
VehicleDrivetrainType_FWD,
VehicleDrivetrainType_RWD,
VehicleDrivetrainType_AWD
};
```

```
NativeDB Introduced: v3258
```

## Parameters
* **vehicleModel**: The hash of the vehicle model to check.

## Return value
Returns the vehicle's drivetrain type.

## Examples
```lua
local vehicleHash = GetHashKey("elegy")
RequestModel(vehicleHash)
repeat
Wait(0)
until HasModelLoaded(vehicleHash)

local driveTrainType = GetVehicleDriveTrainType(vehicleHash)

if driveTrainType == 1 then
-- FWD
print(GetLabelText("FMMC_DT_FWD"))
elseif driveTrainType == 2 then
-- RWD
print(GetLabelText("FMMC_DT_RWD"))
elseif driveTrainType == 3 then
-- AWD
print(GetLabelText("FMMC_DT_AWD"))
else
print("invalid")
end
```

0 comments on commit af1349a

Please sign in to comment.