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 SourceSpawnVehicleAsync(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. |
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. |