OpenMod Docs OpenMod Docs
OpenMod Docs OpenMod Docs
OpenMod .NET Plugin Framework.

Interface IVehicleSpawner

The service for spawning vehicles.

Namespace: OpenMod.Extensions.Games.Abstractions.Vehicles
Assembly: OpenMod.Extensions.Games.Abstractions.dll
Syntax
public interface IVehicleSpawner

Methods

| Improve this Doc View Source

SpawnVehicleAsync(IPlayer, String, IVehicleState)

Spawns a vehicle for the given player.

Declaration
Task<IVehicle> SpawnVehicleAsync(IPlayer player, string vehicleAssetId, IVehicleState state = null)
Parameters
Type Name Description
IPlayer player

The player to spawn the vehicle for.

System.String vehicleAssetId

The ID of the vehicle asset.

IVehicleState state

The optional state of the vehicle.

Returns
Type Description
Task<IVehicle>

The spawned vehicle if successful; otherwise, null.

| Improve this Doc View Source

SpawnVehicleAsync(Vector3, Quaternion, String, IVehicleState)

Spawns a vehicle at the given position.

Declaration
Task<IVehicle> SpawnVehicleAsync(Vector3 position, Quaternion rotation, string vehicleAssetId, IVehicleState state = null)
Parameters
Type Name Description
Vector3 position

The position to spawn the vehicle at.

Quaternion rotation

The rotation to spawn the vehicle in.

System.String vehicleAssetId

The ID of the vehicle asset.

IVehicleState state

The optional state of the vehicle.

Returns
Type Description
Task<IVehicle>

The spawned vehicle if successful; otherwise, null.

Extension Methods

VehicleSpawnerExtensions.SpawnVehicleAsync(IVehicleSpawner, IPlayer, String)
VehicleSpawnerExtensions.SpawnVehicleAsync(IVehicleSpawner, Vector3, String, IVehicleState)
DisposeHelper.DisposeSyncOrAsync(Object)