-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweak(extra-natives/five): Changed requested stuff for GET_VEHICLE_GE…
…AR_RATIO and SET_VEHICLE_GEAR_RATIO
- Loading branch information
Showing
3 changed files
with
28 additions
and
23 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
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 |
---|---|---|
@@ -1,38 +1,41 @@ | ||
--- | ||
ns: CFX | ||
apiset: client | ||
game: gta5 | ||
--- | ||
## GET_VEHICLE_GEAR_RATIO | ||
|
||
```c | ||
float GET_VEHICLE_GEAR_RATIO(Vehicle vehicle, int gear); | ||
``` | ||
Gets vehicles gear ratio on choosen gear. | ||
## Parameters | ||
* **vehicle**: The vehicle handle. | ||
* **gear**: The vehicles gear you want to get. | ||
## Examples | ||
```lua | ||
local Vehicle = GetVehiclePedIsIn(PlayerPedId(-1)) | ||
local vehicle = GetVehiclePedIsIn(PlayerPedId(-1)) | ||
local currentGear = GetVehicleCurrentGear(Vehicle) | ||
print(GetVehicleGearRatio(Vehicle, currentGear)) -- will print current vehicle gear to console | ||
print(GetVehicleGearRatio(vehicle, currentGear)) -- will print current vehicle gear to console | ||
``` | ||
|
||
```js | ||
const Vehicle = GetVehiclePedIsIn(PlayerPedId(-1)); | ||
const vehicle = GetVehiclePedIsIn(PlayerPedId(-1)); | ||
const currentGear = GetVehicleCurrentGear(Vehicle); | ||
|
||
console.log(GetVehicleGearRatio(Vehicle, currentGear)); // will print current vehicle gear to console | ||
console.log(GetVehicleGearRatio(vehicle, currentGear)); // will print current vehicle gear to console | ||
``` | ||
|
||
```cs | ||
using static CitizenFX.Core.API; | ||
|
||
Vehicle veh = Game.PlayerPed.CurrentVehicle; | ||
int currentGear = GetVehicleCurrentGear(veh.Handle); | ||
Vehicle vehicle = Game.PlayerPed.CurrentVehicle; | ||
int currentGear = GetVehicleCurrentGear(vehicle.Handle); | ||
|
||
Debug.WriteLine($"{GetVehicleGearRatio(veh.Handle, currentGear)}"); | ||
Debug.WriteLine($"{GetVehicleGearRatio(vehicle.Handle, currentGear)}"); | ||
``` |
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