Athena.vehicle.get ​
Functions ​
ownedVehicleByDatabaseID ​
Usage
Athena.vehicle.get.ownedVehicleByDatabaseID(id): Promise<player>
Returns an owned vehicle by Database ID.
Export
Parameters ​
| Name | Type |
|---|---|
id | string | number |
Returns ​
Promise<player>
Defined in ​
ownedVehicleByDocumentID ​
Usage
Athena.vehicle.get.ownedVehicleByDocumentID(_id): Promise<player>
Returns an owned vehicle by Document ID.
Export
Parameters ​
| Name | Type |
|---|---|
_id | string |
Returns ​
Promise<player>
Defined in ​
ownedVehiclesByPlayer ​
Usage
Athena.vehicle.get.ownedVehiclesByPlayer<T>(playerOrDocumentID): Promise<T[]>
Returns a list of vehicle documents owned by the player.
Export
Type parameters ​
| Name | Type |
|---|---|
T | OwnedVehicle |
Parameters ​
| Name | Type |
|---|---|
playerOrDocumentID | any |
Returns ​
Promise<T[]>
Defined in ​
spawnedVehicleByDatabaseID ​
Usage
Athena.vehicle.get.spawnedVehicleByDatabaseID(id): alt.Vehicle | undefined
Returns a spawned vehicle by their database identifier.
Not to be confused with _id.
Export
Parameters ​
| Name | Type |
|---|---|
id | string | number |
Returns ​
alt.Vehicle | undefined
Defined in ​
spawnedVehicleByDocumentID ​
Usage
Athena.vehicle.get.spawnedVehicleByDocumentID(_id): alt.Vehicle | undefined
Returns a spawned vehicle by their unique database _id.
Export
Parameters ​
| Name | Type |
|---|---|
_id | string |
Returns ​
alt.Vehicle | undefined
Defined in ​
spawnedVehicleByEntityID ​
Usage
Athena.vehicle.get.spawnedVehicleByEntityID(id): any
Used the internal alt:V Identifiers to find a vehicle.
These IDs always change, and are never the same.
Export
Parameters ​
| Name | Type |
|---|---|
id | number |
Returns ​
any
Defined in ​
temporaryVehicles ​
Usage
Athena.vehicle.get.temporaryVehicles(): alt.Vehicle[]
Get all temporary vehicles.
Example ​
const vehicles = Athena.vehicle.get.temporaryVehicles();Returns ​
alt.Vehicle[]
An array of temporary vehicles.
Defined in ​
vehiclesSpawnedByPlayer ​
Usage
Athena.vehicle.get.vehiclesSpawnedByPlayer(playerOrDocumentID): any
Takes a player instance, or _id and returns all spawned & owned vehicles
Example ​
function something(player: alt.Player) {
const vehicles = Athena.vehicle.get.vehiclesSpawnedByPlayer(player);
}Parameters ​
| Name | Type |
|---|---|
playerOrDocumentID | any |
Returns ​
any
An array of vehicles owned and spawned by a player.
Defined in ​
vehiclesWithOwnership ​
Usage
Athena.vehicle.get.vehiclesWithOwnership(): alt.Vehicle[]
Get all owned vehicles.
Example ​
const vehicles = Athena.vehicle.get.vehiclesWithOwnership();Returns ​
alt.Vehicle[]
An array of owned vehicles.
V5 Docs