VehicleState plugin dependency
The VehicleState plugin provides information about the current vehicle state. The functionality was moved away from Dashboard into Openplanet 1.22.4 as its own dependency plugin shipped with Openplanet, so that every plugin can benefit from its functionality.
Debug window
In the VehicleState plugin settings, you can turn on the debugging window. This lets you see the current vehicle states in a UI.

Getting started
To get started with the VehicleState plugin, add a dependency to it in your info.toml:
[script]
dependencies = [ "VehicleState" ]
API
The API consists out of the following functions:
VehicleState::GetViewingPlayer
Gets the currently viewed player. This can be the local player or the player being spectated.
Returns: CSmPlayer@ on Trackmania, CGamePlayer@ on Maniaplanet, or CGameMobil@ on Trackmania Turbo.
VehicleState::ViewingPlayerState
Gets the CSceneVehicleVisState handle for the currently viewed player. Note that this can be a valid state even if GetViewingPlayer() returns null!
Returns: CSceneVehicleVisState@ on Trackmania. On Maniaplanet and TrackMania Turbo, it will return a wrapper containing a subset of the API for Trackmania.
VehicleState::GetRPM
Get RPM for vehicle vis.
Parameters:
CSceneVehicleVisState@ visThe vehicle state.
Returns: float
VehicleState::GetSideSpeed
Get relative side speed for vehicle.
Parameters:
CSceneVehicleVisState@ visThe vehicle state.
Returns: float
VehicleState::GetWheelDirt
Get wheel dirt amount for vehicle vis. This function only exists for Trackmania!
Parameters:
CSceneVehicleVisState@ visThe vehicle state.int wThe wheel. Use one of the following: 0 = Front Left, 1 = Front Right, 2 = Rear Left, 3 = Rear Right
Returns: float
VehicleState::GetWheelFalling
Get wheel falling state, and if in water. This function only exists for Trackmania!
Parameters:
CSceneVehicleVisState@ visThe vehicle state.int wThe wheel. Use one of the following: 0 = Front Left, 1 = Front Right, 2 = Rear Left, 3 = Rear Right
Returns: FallingState (FallingAir, FallingWater, RestingGround, RestingWater, GlidingGround)
VehicleState::GetLastTurboLevel
Get the last turbo level that the vehicle touched. This will return the last level even if the vehicle is not currently in contact with a turbo gate/surface. This function only exists for Trackmania!
Parameters:
CSceneVehicleVisState@ visThe vehicle state.
Returns: TurboLevel (None, Normal, Super, RouletteNormal, RouletteSuper, RouletteUltra)
VehicleState::GetReactorFinalTimer
Get a timer which counts from 0.0 to 1.0 in the final second of reactor boost. Doesn't seem to work when watching a replay. This function only exists for Trackmania!
Parameters:
CSceneVehicleVisState@ visThe vehicle state.
Returns: float
VehicleState::GetCruiseDisplaySpeed
Get the current speed displayed on the back of the car if under the influence of Cruise Control. If not in Cruise Control, returns 0. This function only exists for Trackmania!
Parameters:
CSceneVehicleVisState@ visThe vehicle state.
Returns: int
VehicleState::GetVehicleType
Get the current vehicle type. This function only exists for Trackmania!
Parameters:
CSceneVehicleVisState@ visThe vehicle state.
Returns: VehicleType (CharacterPilot, CarSport, CarSnow, CarRally, CarDesert)
VehicleState::GetVis
Get vehicle vis from a given player. Not supported on Turbo.
Parameters:
ISceneVis@ sceneVisThe scene visibility object. You can get this fromGetApp().GameScene.CSmPlayer@ playerThe player.
Returns: CSceneVehicleVis@ on Trackmania, CSceneVehicleVisState@ on Maniaplanet.
VehicleState::GetVisFromId
Get vehicle vis from a given entity ID. Only supported on Trackmania.
Parameters:
ISceneVis@ sceneVisThe scene visibility object. You can get this fromGetApp().GameScene.uint vehicleEntityIdThe entity ID.
Returns: CSceneVehicleVis@
VehicleState::GetSingularVis
Get the only existing vehicle vis state, if there is only one. Otherwise, this returns null. Not supported on Turbo.
Parameters:
ISceneVis@ sceneVisThe scene visibility object. You can get this fromGetApp().GameScene.
Returns: CSceneVehicleVis@ on Trackmania, CSceneVehicleVisState@ on Maniaplanet.
VehicleState::GetAllVis
Get all vehicle vis states. Mostly used for debugging. Not supported on Turbo.
Parameters:
ISceneVis@ sceneVisThe scene visibility object. You can get this fromGetApp().GameScene.
Returns: CSceneVehicleVis@[] on Trackmania, CSceneVehicleVisState@[] on Maniaplanet.