Skip to content
On this page

Athena.vehicle.ownership

Functions

addCharacter

Usage

Athena.vehicle.ownership.addCharacter(vehicle, player): Promise<boolean>

Add a character to the owned vehicle

Parameters

NameTypeDescription
vehicleVehicleAn alt:V Vehicle Entity
playerPlayerAn alt:V Player Entity

Returns

Promise<boolean>

Defined in

server/vehicle/ownership.ts:230

Usage

Athena.vehicle.ownership.addCharacter(vehicle, id): Promise<boolean>

Add a character to the owned vehicle

Parameters

NameTypeDescription
vehicleVehicleAn alt:V Vehicle Entity
idstring

Returns

Promise<boolean>

Defined in

server/vehicle/ownership.ts:239


get

Usage

Athena.vehicle.ownership.get(vehicle): string | undefined

Return the owner of a vehicle's database identifier

Parameters

NameTypeDescription
vehicleVehicleAn alt:V Vehicle Entity

Returns

string | undefined

Defined in

server/vehicle/ownership.ts:189


getAsPlayer

Usage

Athena.vehicle.ownership.getAsPlayer(vehicle): alt.Player | undefined

Return the owner of a vehicle based on player

Parameters

NameTypeDescription
vehicleVehicleAn alt:V Vehicle Entity

Returns

alt.Player | undefined

Defined in

server/vehicle/ownership.ts:209


hasGroupPermission

Usage

Athena.vehicle.ownership.hasGroupPermission(player, vehicle): boolean

It's checking if the player has a group permission for the vehicle.

If both the player and the vehicle are in the same group and have at least one matching perm, vehicle access is allowed.

Name

hasGroupPermission

Exports

Parameters

NameType
playerPlayer
vehicleVehicle

Returns

boolean

Defined in

server/vehicle/ownership.ts:105


hasKeys

Usage

Athena.vehicle.ownership.hasKeys(player, vehicle): boolean

Checks if a player's character has a matching permission for a vehicle.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
vehicleVehicleAn alt:V Vehicle Entity

Returns

boolean

Defined in

server/vehicle/ownership.ts:160


hasPermission

Usage

Athena.vehicle.ownership.hasPermission(player, vehicle): boolean

Checks if a player's character has a matching permission for a vehicle.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
vehicleVehicleAn alt:V Vehicle Entity

Returns

boolean

Defined in

server/vehicle/ownership.ts:77


isOwner

Usage

Athena.vehicle.ownership.isOwner(player, vehicle, options?): boolean

A catch all handler for vehicle ownership.

This checks if a player is the true owner of a vehicle.

Options can be specified to check if a passenger has keys and so on and so forth.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
vehicleVehicleAn alt:V Vehicle Entity
optionsObject-
options.includeAdminOverride?boolean-
options.includeGroupPermissions?boolean-
options.includeKeys?boolean-
options.includePermissions?boolean-
options.preventWhileAttached?boolean-

Returns

boolean

Defined in

server/vehicle/ownership.ts:17


override

Usage

Athena.vehicle.ownership.override(functionName, callback): any

Used to override vehicle ownership functionality

Parameters

NameType
functionName"isOwner"
callback(player: Player, vehicle: Vehicle, options: { includeAdminOverride?: boolean ; includeGroupPermissions?: boolean ; includeKeys?: boolean ; includePermissions?: boolean ; preventWhileAttached?: boolean }) => boolean

Returns

any

Defined in

server/vehicle/ownership.ts:374

Usage

Athena.vehicle.ownership.override(functionName, callback): any

Used to override vehicle ownership functionality

Parameters

NameType
functionName"hasPermission"
callback(player: Player, vehicle: Vehicle) => boolean

Returns

any

Defined in

server/vehicle/ownership.ts:375

Usage

Athena.vehicle.ownership.override(functionName, callback): any

Used to override vehicle ownership functionality

Parameters

NameType
functionName"hasKeys"
callback(player: Player, vehicle: Vehicle) => boolean

Returns

any

Defined in

server/vehicle/ownership.ts:376

Usage

Athena.vehicle.ownership.override(functionName, callback): any

Used to override vehicle ownership functionality

Parameters

NameType
functionName"get"
callback(vehicle: Vehicle) => string | undefined

Returns

any

Defined in

server/vehicle/ownership.ts:377

Usage

Athena.vehicle.ownership.override(functionName, callback): any

Used to override vehicle ownership functionality

Parameters

NameType
functionName"getAsPlayer"
callback(vehicle: Vehicle) => alt.Player | undefined

Returns

any

Defined in

server/vehicle/ownership.ts:378

Usage

Athena.vehicle.ownership.override(functionName, callback): any

Used to override vehicle ownership functionality

Parameters

NameType
functionName"addCharacter"
callback(vehicle: Vehicle, player: Player) => Promise<boolean>(vehicle: Vehicle, id: string) => Promise<boolean>

Returns

any

Defined in

server/vehicle/ownership.ts:379

Usage

Athena.vehicle.ownership.override(functionName, callback): any

Used to override vehicle ownership functionality

Parameters

NameType
functionName"removeCharacter"
callback(vehicle: Vehicle, _id: string) => Promise<boolean>

Returns

any

Defined in

server/vehicle/ownership.ts:380

Usage

Athena.vehicle.ownership.override(functionName, callback): any

Used to override vehicle ownership functionality

Parameters

NameType
functionName"transfer"
callback(vehicle: Vehicle, _id: string) => Promise<boolean>

Returns

any

Defined in

server/vehicle/ownership.ts:381


removeCharacter

Usage

Athena.vehicle.ownership.removeCharacter(vehicle, _id): Promise<boolean>

Remove a character from the owned vehicle keys.

Parameters

NameTypeDescription
vehicleVehicleAn alt:V Vehicle Entity
_idstring-

Returns

Promise<boolean>

Defined in

server/vehicle/ownership.ts:300


transfer

Usage

Athena.vehicle.ownership.transfer(vehicle, _id): Promise<boolean>

Transfer ownership of a vehicle.

Assign a vehicle to a specific character id.

Automatically wipes keys on transfer.

Returns true if successfully transferred.

Parameters

NameTypeDescription
vehicleVehicleAn alt:V Vehicle Entity
_idstring

Returns

Promise<boolean>

Defined in

server/vehicle/ownership.ts:341

Created by Stuyk | Est. 2020