setVehicleWheelsRotation | Multi Theft Auto: Wiki Skip to content

setVehicleWheelsRotation

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 manipulate the wheel rotation of a vehicle. Cars, Bikes (including BMX) and Trailers are supported.

Syntax

bool setVehicleWheelsRotation ( vehicle theVehicle, float rotation )
Required Arguments
  • theVehicle: the vehicle whose wheel rotation is to be set.
  • rotation: the new wheel rotation value.

Returns

  • bool: value

Returns true if successful, false otherwise.

Code Examples

shared
addEventHandler("onClientVehicleEnter", root,
function()
local theVeh = getPedOccupiedVehicle(localPlayer)
if setVehicleWheelsRotation(theVeh, 0) then
outputChatBox("SET OK")
else
outputChatBox("SET FAILED")
end
end
)
addEventHandler("onClientPreRender", root, function()
local theVeh = getPedOccupiedVehicle(localPlayer)
if theVeh then
setVehicleWheelsRotation(theVeh, 0)
-- also do it for trailer
local trailer = getVehicleTowedByVehicle(theVeh)
if trailer then
setVehicleWheelsRotation(trailer, 0)
end
end
end)

See Also

Vehicle Functions