setVehicleHandling | Multi Theft Auto: Wiki Skip to content

setVehicleHandling

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function is used to change the handling data of a vehicle.

Note

For functionality reasons, suspension modification is disabled on monster trucks, trains, boats and trailers. Additionally, helicopters are not affected by custom handling. The vehicle-on-wheels handling does not affect planes when they are on the ground either. For more information on this, see issue 2426

Caution

To change handling values of aircraft like maxVelocity , you must first set setAircraftMaxVelocity .

Syntax

bool setVehicleHandling ( element theVehicle, string property, var value )
Required Arguments
  • theVehicle: The vehicle you wish to set the handling of.
  • property: The property you wish to set the handling of the vehicle to.
  • value: MISSING_PARAM_DESC

Returns

  • bool: value

Returns true if the handling was set successfully, false otherwise. See below a list of valid properties and their required values:

Code Examples

shared
function vhandling ( theVehicle )
if getElementModel(theVehicle) == 411 then -------------- vehicle Id
setVehicleHandling(theVehicle, "mass", 300.0)
setVehicleHandling(theVehicle, "turnMass", 200)
setVehicleHandling(theVehicle, "dragCoeff", 4.0 )
setVehicleHandling(theVehicle, "centerOfMass", { 0.0,0.08,-0.09 } )
setVehicleHandling(theVehicle, "percentSubmerged", 103)
setVehicleHandling(theVehicle, "tractionMultiplier", 1.8)
setVehicleHandling(theVehicle, "tractionLoss", 1.0)
setVehicleHandling(theVehicle, "tractionBias", 0.48)
setVehicleHandling(theVehicle, "numberOfGears", 5)
setVehicleHandling(theVehicle, "maxVelocity", 300.0)
setVehicleHandling(theVehicle, "engineAcceleration", 90.0 )
setVehicleHandling(theVehicle, "engineInertia", 5.0)
setVehicleHandling(theVehicle, "driveType", "rwd")
setVehicleHandling(theVehicle, "engineType", "petrol")
setVehicleHandling(theVehicle, "brakeDeceleration", 20.0)
setVehicleHandling(theVehicle, "brakeBias", 0.60)
-----abs----
setVehicleHandling(theVehicle, "steeringLock", 35.0 )
setVehicleHandling(theVehicle, "suspensionForceLevel", 0.85)
setVehicleHandling(theVehicle, "suspensionDamping", 0.15 )
setVehicleHandling(theVehicle, "suspensionHighSpeedDamping", 0.0)
setVehicleHandling(theVehicle, "suspensionUpperLimit", 0.15 )
setVehicleHandling(theVehicle, "suspensionLowerLimit", -0.16)
setVehicleHandling(theVehicle, "suspensionFrontRearBias", 0.5 )
setVehicleHandling(theVehicle, "suspensionAntiDiveMultiplier", 0.0)
setVehicleHandling(theVehicle, "seatOffsetDistance", 0.0)
setVehicleHandling(theVehicle, "collisionDamageMultiplier", 0.00)
--setVehicleHandling(theVehicle, "monetary", 10000) This one is disabled for now
setVehicleHandling(theVehicle, "modelFlags", 1002000)
setVehicleHandling(theVehicle, "handlingFlags", 1000002)
--setVehicleHandling(theVehicle, "headLight", 3) This one is disabled for now
--setVehicleHandling(theVehicle, "tailLight", 2) This one is disabled for now
--setVehicleHandling(theVehicle, "animGroup", 4) This one is disabled for now
end
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), vhandling )

See Also

Vehicle Functions