-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(natives/3258): add new natives for the 3258 gamebuild (#1139)
* 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
1 parent
25b9fe0
commit af1349a
Showing
8 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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**: | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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**: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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**: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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**: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |