Vehicle::getDriveForceCurveValue

From RAGE Multiplayer Wiki
Revision as of 22:51, 24 December 2024 by Shr0x (talk | contribs) (Created page with "{{ClientsideJsFunction}} {{JSContainer| === Summary === Retrieves the drive force output for a specified RPM using a previously created drive force curve. === Syntax === <syntaxhighlight lang="javascript"> mp.game.vehicle.getDriveForceCurveValue(curveNameHash, input); </syntaxhighlight> === Required Parameters === * '''curveNameHash:''' {{RageType|number}} - The hash identifier for the curve. * '''input:''' {{RageType|number}} - The input RPM value. === Return Value...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side
Function

 JavaScript



JavaScript Syntax


Summary

Retrieves the drive force output for a specified RPM using a previously created drive force curve.

Syntax

mp.game.vehicle.getDriveForceCurveValue(curveNameHash, input);

Required Parameters

  • curveNameHash: number - The hash identifier for the curve.
  • input: number - The input RPM value.

Return Value

  • 'number' - The drive force for the given RPM.

Example

const curveHash = mp.game.joaat("custom_curve");
const rpm = 0.5;

const driveForce = mp.game.vehicle.getDriveForceCurveValue(curveHash, rpm);
mp.gui.chat.push(`Drive force for RPM ${rpm}: ${driveForce}`);


See Also