M MY Multiplayer: Wiki
Side
Kind

setVehicleHandling

Client

Changes a vehicle's handling on this client only.

Also exists on the server, with its own implementation: setVehicleHandling

bool setVehicleHandling(vehicle vehicle [, string property = nil, any value = nil])

Parameters

NameTypeDescription
vehiclevehicleThe vehicle.
propertystringThe property's name, as in getVehicleHandling. nil puts every property back to the original handling. An unknown name raises an error.default nil
valueanyThe new value. nil puts the property back to the original handling. Of the property's type: a number, a boolean for ABS, a string for the names, or {x, y, z} (or a vector) for centerOfMass. A wrong type raises an error.default nil

Returns

true if the change was made. false if the value is outside the property's limits or property is not a string.

Example

local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    setVehicleHandling(vehicle, "tractionMultiplier", 1.2)
    setVehicleHandling(vehicle, "centerOfMass", { 0, 0, -0.3 })
end
NoteThe suspension properties only take effect on cars and monster trucks; other vehicles keep the original ones. When the server changes this vehicle's handling, its change replaces the one made here.

See also