Table of Contents

Interface IVehicle.IManagedInterface

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

Represents the managed interface implemented by its unmanaged counterpart.

public interface IVehicle.IManagedInterface : IUnmanagedInterface
Inherited Members

Methods

AddCarriage(IVehicle, int)

Adds a carriage to the vehicle.

void AddCarriage(IVehicle carriage, int pos)

Parameters

carriage IVehicle

The carriage to add.

pos int

The position of the carriage.

AddComponent(int)

Adds a component to the vehicle.

void AddComponent(int component)

Parameters

component int

The component ID to add.

AttachTrailer(IVehicle)

Attaches a trailer to the vehicle.

void AttachTrailer(IVehicle trailer)

Parameters

trailer IVehicle

The trailer to attach.

DetachTrailer()

Detaches the trailer from the vehicle.

void DetachTrailer()

GetAngularVelocity()

Gets the angular velocity of the vehicle.

Vector3 GetAngularVelocity()

Returns

Vector3

The angular velocity of the vehicle.

GetCab()

Gets the cab of the vehicle.

IVehicle GetCab()

Returns

IVehicle

The cab of the vehicle.

GetCarriages()

Gets the carriages attached to the vehicle.

ref CarriagesArray GetCarriages()

Returns

CarriagesArray

The carriages attached to the vehicle.

GetColour()

Gets the primary and secondary colors of the vehicle.

(int, int) GetColour()

Returns

(int offset, int length)

A tuple containing the primary and secondary colors.

GetColour(out Pair<int, int>)

Gets the primary and secondary colors of the vehicle.

void GetColour(out Pair<int, int> result)

Parameters

result Pair<int, int>

The output parameter to store the colors.

GetComponentInSlot(int)

Gets the component in a specific slot of the vehicle.

int GetComponentInSlot(int slot)

Parameters

slot int

The slot ID to check.

Returns

int

The component ID in the specified slot.

GetDamageStatus(out int, out int, out int, out int)

Gets the damage status of the vehicle.

void GetDamageStatus(out int panelStatus, out int doorStatus, out int lightStatus, out int tyreStatus)

Parameters

panelStatus int

The output parameter for the status of the vehicle's panels.

doorStatus int

The output parameter for the status of the vehicle's doors.

lightStatus int

The output parameter for the status of the vehicle's lights.

tyreStatus int

The output parameter for the status of the vehicle's tyres.

GetDriver()

Gets the driver of the vehicle.

IPlayer GetDriver()

Returns

IPlayer

The player who is the driver of the vehicle.

GetHealth()

Gets the health of the vehicle.

float GetHealth()

Returns

float

The health value of the vehicle.

GetHydraThrustAngle()

Gets the hydra thrust angle of the vehicle.

uint GetHydraThrustAngle()

Returns

uint

The hydra thrust angle of the vehicle.

GetInterior()

Gets the interior ID of the vehicle.

int GetInterior()

Returns

int

The interior ID of the vehicle.

GetLandingGearState()

Gets the state of the vehicle's landing gear.

byte GetLandingGearState()

Returns

byte

The state of the landing gear.

GetLastDriverPoolID()

Gets the pool ID of the last driver of the vehicle.

int GetLastDriverPoolID()

Returns

int

The pool ID of the last driver.

GetLastOccupiedTime()

Gets the last time the vehicle was occupied.

ref TimePoint GetLastOccupiedTime()

Returns

TimePoint

The last occupied time of the vehicle.

GetLastSpawnTime()

Gets the last time the vehicle was spawned.

ref TimePoint GetLastSpawnTime()

Returns

TimePoint

The last spawn time of the vehicle.

GetModel()

Gets the model ID of the vehicle.

int GetModel()

Returns

int

The model ID of the vehicle.

GetPaintJob()

Gets the paint job of the vehicle.

int GetPaintJob()

Returns

int

The paint job ID of the vehicle.

GetParams()

Gets the parameters of the vehicle.

VehicleParams GetParams()

Returns

VehicleParams

The parameters of the vehicle.

GetPassengers()

Gets the passengers of the vehicle.

FlatPtrHashSet<IPlayer> GetPassengers()

Returns

FlatPtrHashSet<IPlayer>

A set of players who are passengers in the vehicle.

GetPlate()

Gets the license plate text of the vehicle.

string GetPlate()

Returns

string

The license plate text of the vehicle.

GetRespawnDelay()

Gets the respawn delay of the vehicle.

TimeSpan GetRespawnDelay()

Returns

TimeSpan

The respawn delay of the vehicle.

GetSirenState()

Gets the siren state of the vehicle.

byte GetSirenState()

Returns

byte

The siren state of the vehicle.

GetSpawnData()

Gets the spawn data for the vehicle.

VehicleSpawnData GetSpawnData()

Returns

VehicleSpawnData

The spawn data of the vehicle.

GetTrailer()

Gets the trailer attached to the vehicle.

IVehicle GetTrailer()

Returns

IVehicle

The trailer attached to the vehicle.

GetTrainSpeed()

Gets the train speed of the vehicle.

float GetTrainSpeed()

Returns

float

The train speed of the vehicle.

GetVelocity()

Gets the velocity of the vehicle.

Vector3 GetVelocity()

Returns

Vector3

The velocity of the vehicle.

GetZAngle()

Gets the Z angle (rotation) of the vehicle.

float GetZAngle()

Returns

float

The Z angle of the vehicle.

HasBeenOccupied()

Checks if the vehicle has been occupied.

bool HasBeenOccupied()

Returns

bool

True if the vehicle has been occupied; otherwise, false.

IsDead()

Checks if the vehicle is dead.

bool IsDead()

Returns

bool

True if the vehicle is dead; otherwise, false.

IsOccupied()

Checks if the vehicle is currently occupied.

bool IsOccupied()

Returns

bool

True if the vehicle is occupied; otherwise, false.

IsRespawning()

Checks if the vehicle is respawning.

bool IsRespawning()

Returns

bool

True if the vehicle is respawning; otherwise, false.

IsStreamedInForPlayer(IPlayer)

Checks if the vehicle is streamed in for a specific player.

bool IsStreamedInForPlayer(IPlayer player)

Parameters

player IPlayer

The player to check.

Returns

bool

True if the vehicle is streamed in for the player; otherwise, false.

IsTrailer()

Checks if the vehicle has a trailer attached.

bool IsTrailer()

Returns

bool

True if the vehicle has a trailer attached; otherwise, false.

PutPlayer(IPlayer, int)

Places a player in a specific seat of the vehicle.

void PutPlayer(IPlayer player, int seatID)

Parameters

player IPlayer

The player to place in the vehicle.

seatID int

The seat ID to place the player in.

RemoveComponent(int)

Removes a component from the vehicle.

void RemoveComponent(int component)

Parameters

component int

The component ID to remove.

Repair()

Repairs the vehicle.

void Repair()

Respawn()

Respawns the vehicle.

void Respawn()

SetAngularVelocity(Vector3)

Sets the angular velocity of the vehicle.

void SetAngularVelocity(Vector3 velocity)

Parameters

velocity Vector3

The angular velocity to set.

SetColour(int, int)

Sets the primary and secondary colors of the vehicle.

void SetColour(int col1, int col2)

Parameters

col1 int

The primary color.

col2 int

The secondary color.

SetDamageStatus(int, int, byte, byte, IPlayer)

Sets the damage status of the vehicle.

void SetDamageStatus(int panelStatus, int doorStatus, byte lightStatus, byte tyreStatus, IPlayer vehicleUpdater = default)

Parameters

panelStatus int

The status of the vehicle's panels.

doorStatus int

The status of the vehicle's doors.

lightStatus byte

The status of the vehicle's lights.

tyreStatus byte

The status of the vehicle's tyres.

vehicleUpdater IPlayer

The player updating the vehicle's damage status. Optional.

SetHealth(float)

Sets the health of the vehicle.

void SetHealth(float health)

Parameters

health float

The health value to set.

SetInterior(int)

Sets the interior ID of the vehicle.

void SetInterior(int interiorID)

Parameters

interiorID int

The interior ID to set.

SetPaintJob(int)

Sets the paint job of the vehicle.

void SetPaintJob(int paintjob)

Parameters

paintjob int

The paint job ID to set.

SetParams(ref VehicleParams)

Sets the parameters of the vehicle.

void SetParams(ref VehicleParams parameters)

Parameters

parameters VehicleParams

The parameters to set.

SetParamsForPlayer(IPlayer, ref VehicleParams)

Sets the parameters of the vehicle for a specific player.

void SetParamsForPlayer(IPlayer player, ref VehicleParams parameters)

Parameters

player IPlayer

The player for whom to set the parameters.

parameters VehicleParams

The parameters to set.

SetPlate(string)

Sets the license plate text for the vehicle.

void SetPlate(string plate)

Parameters

plate string

The license plate text to set.

SetRespawnDelay(TimeSpan)

Sets the respawn delay of the vehicle.

void SetRespawnDelay(TimeSpan delay)

Parameters

delay TimeSpan

The respawn delay to set.

SetSiren(bool)

Sets the siren status of the vehicle.

void SetSiren(bool status)

Parameters

status bool

The siren status to set.

SetSpawnData(ref VehicleSpawnData)

Sets the spawn data for the vehicle.

void SetSpawnData(ref VehicleSpawnData data)

Parameters

data VehicleSpawnData

The spawn data to set.

SetVelocity(Vector3)

Sets the velocity of the vehicle.

void SetVelocity(Vector3 velocity)

Parameters

velocity Vector3

The velocity to set.

SetZAngle(float)

Sets the Z angle (rotation) of the vehicle.

void SetZAngle(float angle)

Parameters

angle float

The Z angle to set.

StreamInForPlayer(IPlayer)

Streams the vehicle in for a specific player.

void StreamInForPlayer(IPlayer player)

Parameters

player IPlayer

The player for whom to stream the vehicle.

StreamOutForPlayer(IPlayer)

Streams the vehicle out for a specific player.

void StreamOutForPlayer(IPlayer player)

Parameters

player IPlayer

The player for whom to stream the vehicle out.

StreamedForPlayers()

Gets the players for whom the vehicle is streamed in.

FlatPtrHashSet<IPlayer> StreamedForPlayers()

Returns

FlatPtrHashSet<IPlayer>

A set of players for whom the vehicle is streamed in.

UpdateCarriage(Vector3, Vector3)

Updates the position and velocity of a carriage.

void UpdateCarriage(Vector3 pos, Vector3 veloc)

Parameters

pos Vector3

The position of the carriage.

veloc Vector3

The velocity of the carriage.

UpdateFromDriverSync(ref VehicleDriverSyncPacket, IPlayer)

Updates the vehicle state based on driver synchronization data.

bool UpdateFromDriverSync(ref VehicleDriverSyncPacket vehicleSync, IPlayer player)

Parameters

vehicleSync VehicleDriverSyncPacket

The driver synchronization data.

player IPlayer

The player associated with the synchronization.

Returns

bool

True if the update was successful; otherwise, false.

UpdateFromPassengerSync(ref VehiclePassengerSyncPacket, IPlayer)

Updates the vehicle state based on passenger synchronization data.

bool UpdateFromPassengerSync(ref VehiclePassengerSyncPacket passengerSync, IPlayer player)

Parameters

passengerSync VehiclePassengerSyncPacket

The passenger synchronization data.

player IPlayer

The player associated with the synchronization.

Returns

bool

True if the update was successful; otherwise, false.

UpdateFromTrailerSync(ref VehicleTrailerSyncPacket, IPlayer)

Updates the vehicle state based on trailer synchronization data.

bool UpdateFromTrailerSync(ref VehicleTrailerSyncPacket unoccupiedSync, IPlayer player)

Parameters

unoccupiedSync VehicleTrailerSyncPacket

The trailer synchronization data.

player IPlayer

The player associated with the synchronization.

Returns

bool

True if the update was successful; otherwise, false.

UpdateFromUnoccupied(ref VehicleUnoccupiedSyncPacket, IPlayer)

Updates the vehicle state based on unoccupied synchronization data.

bool UpdateFromUnoccupied(ref VehicleUnoccupiedSyncPacket unoccupiedSync, IPlayer player)

Parameters

unoccupiedSync VehicleUnoccupiedSyncPacket

The unoccupied synchronization data.

player IPlayer

The player associated with the synchronization.

Returns

bool

True if the update was successful; otherwise, false.