Vehicle::setHandling: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "You can find all list of the types here: https://forums.gta5-mods.com/topic/3842/tutorial-handling-meta ==Syntax== <syntaxhighlight lang="javascript">vehicle.setHandling(type...")
 
(Add information on certain handling.meta properties requiring some modification to work correctly as they do not directly map)
Line 1: Line 1:
You can find all list of the types here: https://forums.gta5-mods.com/topic/3842/tutorial-handling-meta
You can find all list of the types here: https://forums.gta5-mods.com/topic/3842/tutorial-handling-meta
==Notes==
'''setHandling''' does not use the exact values from '''handling.meta''' for certain fields, these are as follows:
*'''fInitialDriveMaxFlatVel''' - handling.meta value / 3.6
*'''fBrakeBiasFront''' - handling.meta value * 2
*'''fSteeringLock''' - handling.meta value * 0.017453292
*'''fTractionBiasFront''' - handling.meta value * 2
*'''fSuspensionCompDamp''' - handling.meta value / 10
*'''fSuspensionReboundDamp''' - handling.meta value / 10
*'''fSuspensionBiasFront''' - handling.meta value * 2
*'''fAntiRollBarBiasFront''' - handling.meta value * 2


==Syntax==
==Syntax==
Line 10: Line 29:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
if (mp.players.local.vehicle) {
  mp.players.local.vehicle.setHandling("fMass", 3500);
  mp.players.local.vehicle.setHandling("fInitialDragCoeff", 4.77);
}
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==

Revision as of 16:13, 29 August 2020

You can find all list of the types here: https://forums.gta5-mods.com/topic/3842/tutorial-handling-meta

Notes

setHandling does not use the exact values from handling.meta for certain fields, these are as follows:

  • fInitialDriveMaxFlatVel - handling.meta value / 3.6
  • fBrakeBiasFront - handling.meta value * 2
  • fSteeringLock - handling.meta value * 0.017453292
  • fTractionBiasFront - handling.meta value * 2
  • fSuspensionCompDamp - handling.meta value / 10
  • fSuspensionReboundDamp - handling.meta value / 10
  • fSuspensionBiasFront - handling.meta value * 2
  • fAntiRollBarBiasFront - handling.meta value * 2

Syntax

vehicle.setHandling(type, value);

Required Arguments

  • type: string
  • value: number/string

Return value

  • Undefined

Example

if (mp.players.local.vehicle) {
  mp.players.local.vehicle.setHandling("fMass", 3500);
  mp.players.local.vehicle.setHandling("fInitialDragCoeff", 4.77);
}

See also