Table of Contents

Class VehicleData

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

Provides utility functions and data for vehicle operations.

public static class VehicleData
Inheritance
VehicleData
Inherited Members

Methods

CarColourIndexToColour(int, uint)

Converts a car color index to a color value.

public static extern Colour CarColourIndexToColour(int index, uint alpha = 255)

Parameters

index int

The color index.

alpha uint

The alpha value of the color. Default is 0xFF.

Returns

Colour

The color value corresponding to the index.

GetRandomVehicleColour(int, out int, out int, out int, out int)

Gets random colors for a vehicle.

public static extern void GetRandomVehicleColour(int modelId, out int colour1, out int colour2, out int colour3, out int colour4)

Parameters

modelId int

The vehicle model ID.

colour1 int

The output parameter for the first color.

colour2 int

The output parameter for the second color.

colour3 int

The output parameter for the third color.

colour4 int

The output parameter for the fourth color.

GetVehicleComponentSlot(int)

Gets the slot of a specific vehicle component.

public static extern int GetVehicleComponentSlot(int component)

Parameters

component int

The component ID.

Returns

int

The slot ID of the component.

GetVehicleModelInfo(int, VehicleModelInfoType, out Vector3)

Retrieves information about a vehicle model.

public static extern bool GetVehicleModelInfo(int model, VehicleModelInfoType type, out Vector3 outInfo)

Parameters

model int

The vehicle model ID.

type VehicleModelInfoType

The type of information to retrieve.

outInfo Vector3

The output parameter to store the retrieved information.

Returns

bool

true if the information was successfully retrieved; otherwise, false.

GetVehiclePassengerSeats(int)

Gets the number of passenger seats for a vehicle model.

public static extern byte GetVehiclePassengerSeats(int model)

Parameters

model int

The vehicle model ID.

Returns

byte

The number of passenger seats in the vehicle model.

IsValidComponentForVehicleModel(int, int)

Checks if a component is valid for a specific vehicle model.

public static extern bool IsValidComponentForVehicleModel(int vehicleModel, int componentId)

Parameters

vehicleModel int

The vehicle model ID.

componentId int

The component ID to check.

Returns

bool

true if the component is valid for the vehicle model; otherwise, false.