M MY Multiplayer: Wiki
Side
Kind

setVehicleHydraulics

Shared

Fits or removes a vehicle's hydraulics.

bool setVehicleHydraulics(element vehicle, bool fitted)

Parameters

NameTypeDescription
vehicleelementThe vehicle. It can also be a parent element: every vehicle below it changes.
fittedbooltrue fits them, false removes them.

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.

Called on the server, the change reaches every player.

Example

addCommandHandler("hidraulica", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        setVehicleHydraulics(vehicle, not getVehicleHydraulics(vehicle))
    end
end)

See also