setVehicleWheelStates | Multi Theft Auto: Wiki Skip to content

setVehicleWheelStates

Client-side
Server-side
Shared
Needs checking

This function was partially migrated from the old wiki. Please review manually:

  • Missing section: Wheel-State values

Pair: getVehicleWheelStates

This page is incomplete! Help wanted!

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


This function sets the state of wheels on the vehicle.

Syntax

setVehicleWheelStates ( )

Code Examples

server

This example displays the states of the vehicle's wheels and changes their states if any arguments were passed.

function scriptWheelStates ( thePlayer, command, newFLeft, newRLeft, newFRight, newRRight )
local theVehicle = getPedOccupiedVehicle ( thePlayer )
if ( theVehicle ) then -- check if the player is in a car
if ( newFLeft ) then -- if there's at least one argument passed, we change the wheel states
if not setVehicleWheelStates ( theVehicle, newFLeft, newRLeft, newFRight, newRRight ) then
outputChatBox ( "Bad arguments." )
end
end
local states = { [0]="inflated", [1]="flat", [2]="fallen off" } -- we store the states in a table
local frontLeft, rearLeft, frontRight, rearRight = getVehicleWheelStates ( theVehicle )
outputChatBox ( "Your vehicle's wheel states:", thePlayer ) -- output them in the chatbox
outputChatBox ( "Front-Left: " .. states [ frontLeft ] .. ", Front-Right: " .. states [ frontRight ] ..
", Rear-Left: " .. states [ rearLeft ] .. ", Rear-Right: " .. states [ rearRight ], thePlayer )
else
outputChatBox ( "You have to be in a vehicle to use this command.", thePlayer )
end
end
addCommandHandler ( "wheelstates", scriptWheelStates )

See Also

Vehicle Functions