M MY Multiplayer: Wiki
Side
Kind

setVehicleSuspensionHeight

Shared

Raises or lowers a vehicle's suspension.

bool setVehicleSuspensionHeight(element vehicle, float height)

Parameters

NameTypeDescription
vehicleelementThe vehicle. It can also be a parent element: every vehicle below it changes.
heightfloatHeight in metres, from -1 to 1. Negative lowers, positive raises, 0 goes back to normal.

Returns

true if the element given is a vehicle and it changed. With a parent element, the vehicles below it change even when the result is false.

It only applies to vehicles that ride on wheels. Lowering stops before the wheels reach the wheel arches. Called on the server, the change reaches every player.

Example

addCommandHandler("rebaixar", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        setVehicleSuspensionHeight(vehicle, -0.08)
    end
end)
NoteA value outside -1 to 1 is an error.

See also