Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(extra-natives/five): GetVehicleDashboardCurrentGear #2914

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct VehicleDashboardData
float temp;
float vacuum;
float boost;
float waterTemp;
float currentGear;
float oilTemp;
float oilPressure;
char _pad[0x3F]; // aircraft data
Expand Down Expand Up @@ -938,9 +938,9 @@ static HookFunction initFunction([]()
context.SetResult<float>(g_DashboardData.boost);
});

fx::ScriptEngine::RegisterNativeHandler("GET_VEHICLE_DASHBOARD_WATER_TEMP", [](fx::ScriptContext& context)
fx::ScriptEngine::RegisterNativeHandler("GET_VEHICLE_DASHBOARD_CURRENT_GEAR", [](fx::ScriptContext& context)
{
context.SetResult<float>(g_DashboardData.waterTemp);
context.SetResult<float>(g_DashboardData.currentGear);
});

fx::ScriptEngine::RegisterNativeHandler("GET_VEHICLE_DASHBOARD_OIL_PRESSURE", [](fx::ScriptContext& context)
Expand Down
16 changes: 16 additions & 0 deletions ext/native-decls/GetVehicleDashboardCurrentGear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
ns: CFX
apiset: client
game: gta5
aliases: ["GET_VEHICLE_DASHBOARD_WATER_TEMP"]
---
## GET_VEHICLE_DASHBOARD_CURRENT_GEAR

```c
float GET_VEHICLE_DASHBOARD_CURRENT_GEAR();
```

Retrieves the current gear displayed on the dashboard of the vehicle the player is in, returned as a float. This value represents the gear shown in the instrument cluster, such as "R" (0.0) or positive values (e.g., 1.0, 2.0, etc.) for drive gears.

## Return value
The current gear.
10 changes: 0 additions & 10 deletions ext/native-decls/GetVehicleDashboardWaterTemp.md

This file was deleted.

Loading