Table of Contents

Class LandVehicle

Namespace
S1API.Vehicles
Assembly
S1API.dll

Represents a land vehicle in the game.

public class LandVehicle
Inheritance
LandVehicle
Inherited Members
Extension Methods

Constructors

LandVehicle(string)

Creates a new LandVehicle instance.

public LandVehicle(string vehicleCode)

Parameters

vehicleCode string

Properties

Color

Vehicle's color.

public VehicleColor Color { get; set; }

Property Value

VehicleColor

GUID

Unique GUID string for this vehicle.

public string GUID { get; }

Property Value

string

IsOccupied

If this vehicle has any occupants

public bool IsOccupied { get; set; }

Property Value

bool

IsPlayerOwned

If the vehicle is owned by the player.

public bool IsPlayerOwned { get; set; }

Property Value

bool

Storage

Trunk space

public StorageInstance Storage { get; }

Property Value

StorageInstance

TopSpeed

Vehicle's top speed.

public float TopSpeed { get; set; }

Property Value

float

VehiclePrice

Vehicle price.

public float VehiclePrice { get; set; }

Property Value

float

Methods

AlignTo(Transform, ParkingAlignment, bool)

public void AlignTo(Transform target, ParkingAlignment type, bool network = false)

Parameters

target Transform
type ParkingAlignment
network bool

ApplyColor(VehicleColor)

public void ApplyColor(VehicleColor col)

Parameters

col VehicleColor

DestroyVehichle()

Deletes the land vehicle

public void DestroyVehichle()

ExitPark(bool)

Exit parking spot, and optionally, the parking lot

public void ExitPark(bool moveToExitPoint = true)

Parameters

moveToExitPoint bool

Park(ParkingData, bool)

Parks the vehicle in the specified slot ParkingData

public void Park(ParkingData parkData, bool network)

Parameters

parkData ParkingData
network bool

SetVisible(bool)

Set this vehicle as visible or not

public void SetVisible(bool vis)

Parameters

vis bool

Spawn(Vector3, Quaternion)

Spawns the vehicle in the game world.

public void Spawn(Vector3 position, Quaternion rotation)

Parameters

position Vector3

Position in the world

rotation Quaternion

Rotation of the vehicle

Events

OnCollision

When this vehicle has collided with something

public event Action<Collision> OnCollision

Event Type

Action<Collision>

OnHandbrakeApplied

When the handbrake has been applied

public event Action OnHandbrakeApplied

Event Type

Action

OnVehicleStart

When this vehicle has started

public event Action OnVehicleStart

Event Type

Action

OnVehicleStop

When this vehicle has stopped

public event Action OnVehicleStop

Event Type

Action