Vehicle

API reference for Vehicle in @erlcjs/core.

Represents a spawned vehicle in the ER:LC server.

Signature:

declare class Vehicle extends Base

Extends: Base

#Constructors

Constructor

Modifiers

Description

(constructor)(server, data)

Creates an instance of Vehicle.

#Properties

Property

Modifiers

Type

Description

colorHex

string

The hexadecimal color code of the vehicle.

colorName

string

The user-friendly color name of the vehicle.

name

string

The name/model of the vehicle.

owner?

Player

(Optional) The Player instance representing the owner, if they are currently online.

ownerId

number

The UserId of the vehicle owner.

ownerUsername

string

The username of the vehicle owner.

plate

string

The license plate text of the vehicle.

texture?

string

(Optional) The custom texture identifier, if any.

#Methods

Method

Modifiers

Description

_patch(data)

Patches the Vehicle structure with new raw data.

toJSON()

Converts this Vehicle instance to raw JSON representation.