VehicleManager
@vimp-mp/types 2.0.1Creates local vehicles and tracks server-owned vehicle wrappers.
ts
interface VehicleManagerMembers
all
ts
readonly all: Array<Vehicle>All known non-destroyed vehicles, including remote vehicles with handle === 0.
count
ts
readonly count: numberNumber of known non-destroyed vehicles.
create
ts
create(model: string | number, position: Vec3, rotation?: Vec3, options?: VehicleCreateOptions): Vehicle | nullCreates a client-local vehicle, or returns null if its model cannot be loaded.
destroy
ts
destroy(id: number): booleanDestroys the client-local vehicle identified by its wrapper id.
getById
ts
getById(id: number): Vehicle | nullReturns a known vehicle by client-local wrapper id.
getByRemoteId
ts
getByRemoteId(remoteId: number): Vehicle | nullReturns a remote vehicle by server/network id, including vehicles that are not currently streamed.
getDisplayNameFromModel
ts
getDisplayNameFromModel(model: string | number): stringReturns GTA's localized display-name key for a vehicle model.