Skip to content
On this page

Athena.vehicle.events

Type Aliases

AthenaVehicleEvents

Ƭ AthenaVehicleEvents: "engine-started" | "engine-stopped" | "door-opened" | "door-closed" | "doors-locked" | "doors-lock-changed" | "doors-unlocked" | "vehicle-destroyed" | "vehicle-repaired" | "vehicle-spawned" | "vehicle-repaired"

Defined in

server/vehicle/events.ts:4

Functions

on

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when a vehicle has been spawned / created.

Parameters

NameType
eventName"vehicle-spawned"
callback(vehicle: Vehicle) => void

Returns

any

Defined in

server/vehicle/events.ts:45

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when a doors are unlocked by a player.

Parameters

NameType
eventName"doors-unlocked"
callback(vehicle: Vehicle, player: Player) => void

Returns

any

Defined in

server/vehicle/events.ts:53

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when a doors are locked by a player.

Parameters

NameType
eventName"doors-locked"
callback(vehicle: Vehicle, player: Player) => void

Returns

any

Defined in

server/vehicle/events.ts:61

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when a door locks are updated for any status.

Parameters

NameType
eventName"doors-lock-changed"
callback(vehicle: Vehicle, player: Player) => void

Returns

any

Defined in

server/vehicle/events.ts:69

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when a door is closed by a player.

Parameters

NameType
eventName"door-closed"
callback(vehicle: Vehicle, door: number, player: Player) => void

Returns

any

Defined in

server/vehicle/events.ts:77

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when a door is opened by a player.

Parameters

NameType
eventName"door-opened"
callback(vehicle: Vehicle, door: number, player: Player) => void

Returns

any

Defined in

server/vehicle/events.ts:88

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when the engine is stopped by a player.

Parameters

NameType
eventName"engine-stopped"
callback(vehicle: Vehicle, player: Player) => void

Returns

any

Defined in

server/vehicle/events.ts:99

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when the engine is started by a player.

Parameters

NameType
eventName"engine-started"
callback(vehicle: Vehicle, player: Player) => void

Returns

any

Defined in

server/vehicle/events.ts:107

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when the internal repair function is called.

Does not work for vehicle.repair();

Parameters

NameType
eventName"vehicle-repaired"
callback(vehicle: Vehicle) => void

Returns

any

Defined in

server/vehicle/events.ts:117

Usage

Athena.vehicle.events.on(eventName, callback): any

Triggered when a vehicle is destroyed, and despawned.

This event is only fired by a default system.

Parameters

NameType
eventName"vehicle-destroyed"
callback(vehicle: Vehicle, document: any) => void

Returns

any

Defined in

server/vehicle/events.ts:127


trigger

Usage

Athena.vehicle.events.trigger<CustomEvents>(eventName, vehicle, ...args): void

Usually called by internal functions. Can be used to manually trigger an Athena Event though.

Type parameters

NameType
CustomEventsAthenaVehicleEvents

Parameters

NameTypeDescription
eventNameCustomEvents
vehicleVehicleAn alt:V Vehicle Entity
...argsany[]-

Returns

void

Defined in

server/vehicle/events.ts:25

Created by Stuyk | Est. 2020