Skip to content
On this page

AthenaShared.interfaces.vehicleState.VehicleState

shared/interfaces/vehicleState.VehicleState

Wraps the alt.Vehicle properties that can be set.

Used to auto-sync a vehicle from a database.

Interface

VehicleState

Properties

activeRadioStation

activeRadioStation: number

Gets or sets the active radio station.

Defined in

shared/interfaces/vehicleState.ts:18


boatAnchorActive

boatAnchorActive: boolean

Defined in

shared/interfaces/vehicleState.ts:255


bodyAdditionalHealth

bodyAdditionalHealth: number

Gets or sets the additional body health.

Defined in

shared/interfaces/vehicleState.ts:23


bodyHealth

bodyHealth: number

Gets or sets the body health.

Defined in

shared/interfaces/vehicleState.ts:27


counterMeasureCount

counterMeasureCount: number

Defined in

shared/interfaces/vehicleState.ts:261


customPrimaryColor

customPrimaryColor: RGBA

Gets or sets the custom primary color as a RGBA type

Defined in

shared/interfaces/vehicleState.ts:32


customSecondaryColor

customSecondaryColor: RGBA

Gets or sets the custom secondary color as a RGBA type.

Example

js
const someVehicle = new alt.Vehicle('elegy', 0, 0, 0, 0, 0, 0);
someVehicle.customSecondaryColor = new alt.RGBA(255, 0, 0);
console.log(`Vehicle custom secondary color was set to red`);

Defined in

shared/interfaces/vehicleState.ts:43


customTires

customTires: boolean

Gets or sets if the vehicle instance has custom tires.

Defined in

shared/interfaces/vehicleState.ts:48


darkness

darkness: number

Applies some decoration effects to the vehicle (e.g.: It makes the hydra looking rusty or applies snow to the front bumper of policeold1). Does not work on every vehicle model.

Defined in

shared/interfaces/vehicleState.ts:53


dashboardColor

dashboardColor: number

Gets or sets the dashboard color of the vehicle.

Dash board colors range from 0 to 159.

Defined in

shared/interfaces/vehicleState.ts:61


dirtLevel

dirtLevel: number

Gets or sets the dirt level of the vehicle.

Defined in

shared/interfaces/vehicleState.ts:66


driftModeEnabled

driftModeEnabled: boolean

Gets or sets the drift mode state of the vehicle.

Defined in

shared/interfaces/vehicleState.ts:183


engineHealth

engineHealth: number

Gets or sets the current engine health.

Default maximum engine health is 1000. The vehicle.repair() function should be used to repair a vehicle if the engine health is less than or equal to zero.

Defined in

shared/interfaces/vehicleState.ts:75


engineOn

engineOn: boolean

Gets or sets the engine state of the vehicle.

The functionality of the vehicle engine can be triggered on either client-side or server-side. If you want to trigger the engine on client-side use native.setVehicleEngineOn.

Defined in

shared/interfaces/vehicleState.ts:83


headlightColor

headlightColor: number

Gets or sets the headlight color of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:88


hybridExtraActive

hybridExtraActive: boolean

Defined in

shared/interfaces/vehicleState.ts:265


hybridExtraState

hybridExtraState: number

Defined in

shared/interfaces/vehicleState.ts:267


interiorColor

interiorColor: number

Gets or sets the interior color of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:92


isMissionTrain

isMissionTrain: boolean

Gets or sets if the created train is a mission train.

Defined in

shared/interfaces/vehicleState.ts:188


isTrainCaboose

isTrainCaboose: boolean

Gets or sets if the train is a caboose.

Defined in

shared/interfaces/vehicleState.ts:217


isTrainEngine

isTrainEngine: boolean

Gets or sets if the train is the engine of the train.

Defined in

shared/interfaces/vehicleState.ts:212


lightState

lightState: number

Defined in

shared/interfaces/vehicleState.ts:257


lightsMultiplier

lightsMultiplier: number

Gets or sets the lights intensity and distance of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:96


livery

livery: number

Gets or sets the livery of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:100


lockState

lockState: VehicleLockState

Gets or sets the lock state of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:104


manualEngineControl

manualEngineControl: boolean

Enables or disables the manual engine control.

Defined in

shared/interfaces/vehicleState.ts:108


neon

neon: IVehicleNeon

Enables or disables a neon light on a specific position.

Defined in

shared/interfaces/vehicleState.ts:113


neonColor

neonColor: RGBA

Gets or sets the color of the neon lights.

Defined in

shared/interfaces/vehicleState.ts:118


numberPlateIndex

numberPlateIndex: number

Gets or sets the current number plate style.

Defined in

shared/interfaces/vehicleState.ts:123


numberPlateText

numberPlateText: string

Gets or sets the current text displayed on the number plate.

Defined in

shared/interfaces/vehicleState.ts:128


pearlColor

pearlColor: number

Gets or sets the pearl color of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:133


petrolTankHealth

petrolTankHealth: number

Gets or sets the current health amount of the petrol tank.

Defined in

shared/interfaces/vehicleState.ts:138


primaryColor

primaryColor: number

Gets or sets the current primary color of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:143


rocketRefuelSpeed

rocketRefuelSpeed: number

Defined in

shared/interfaces/vehicleState.ts:259


roofLivery

roofLivery: number

Gets or sets the roof livery of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:148


roofState

roofState: boolean

Gets or sets the roof state of a vehicle (closed or open).

Defined in

shared/interfaces/vehicleState.ts:153


scriptMaxSpeed

scriptMaxSpeed: number

Defined in

shared/interfaces/vehicleState.ts:263


secondaryColor

secondaryColor: number

Gets or sets the current secondary color.

Defined in

shared/interfaces/vehicleState.ts:158


sirenActive

sirenActive: boolean

Gets or sets the siren state of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:163


tireSmokeColor

tireSmokeColor: RGBA

Gets or sets the color of the tire smoke.

Defined in

shared/interfaces/vehicleState.ts:168


trainCarriageConfigIndex

trainCarriageConfigIndex: number

Gets or sets the config index of the train's carriage.

Defined in

shared/interfaces/vehicleState.ts:247


trainConfigIndex

trainConfigIndex: number

Gets or sets the trains config index.

Remarks

You can find a list of all possible config indices in the trains.xml. Valid indices are between 1 and 25.

Defined in

shared/interfaces/vehicleState.ts:202


trainCruiseSpeed

trainCruiseSpeed: number

Gets or sets the cruise speed of the train.

Defined in

shared/interfaces/vehicleState.ts:242


trainDirection

trainDirection: boolean

Gets or sets the direction of the train.

Defined in

shared/interfaces/vehicleState.ts:227


trainDistanceFromEngine

trainDistanceFromEngine: number

Gets or sets the distance of the trains to the engine.

Defined in

shared/interfaces/vehicleState.ts:207


trainForceDoorsOpen

trainForceDoorsOpen: boolean

Gets or sets if the doors of the trains should be forced open.

Defined in

shared/interfaces/vehicleState.ts:237


trainPassengerCarriages

trainPassengerCarriages: boolean

Gets or sets if the train is a passenger carriage.

Defined in

shared/interfaces/vehicleState.ts:222


trainRenderDerailed

trainRenderDerailed: boolean

Gets or sets if the trains is rendered derailed.

Defined in

shared/interfaces/vehicleState.ts:232


trainTrackId

trainTrackId: number

Gets or sets the track id of the train.

Remarks

Valid track ids are between 0 and 11.

Defined in

shared/interfaces/vehicleState.ts:195


trainUnk1

trainUnk1: boolean

Defined in

shared/interfaces/vehicleState.ts:249


trainUnk2

trainUnk2: boolean

Defined in

shared/interfaces/vehicleState.ts:251


trainUnk3

trainUnk3: boolean

Defined in

shared/interfaces/vehicleState.ts:253


wheelColor

wheelColor: number

Gets or sets the wheel color.

Defined in

shared/interfaces/vehicleState.ts:173


windowTint

windowTint: WindowTint

Gets or sets the window tint of a vehicle.

Defined in

shared/interfaces/vehicleState.ts:178

Created by Stuyk | Est. 2020