Table of Contents

Interface IBaseObject.IManagedInterface

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

Represents the managed interface implemented by its unmanaged counterpart.

public interface IBaseObject.IManagedInterface : IUnmanagedInterface
Inherited Members

Methods

AttachToVehicle(IVehicle, Vector3, Vector3)

Attaches the object to a vehicle at the specified offset and rotation.

void AttachToVehicle(IVehicle vehicle, Vector3 offset, Vector3 rotation)

Parameters

vehicle IVehicle

The vehicle to attach the object to.

offset Vector3

The offset from the vehicle's center.

rotation Vector3

The rotation of the object relative to the vehicle.

GetAttachmentData()

Gets the attachment data of the object.

ref ObjectAttachmentData GetAttachmentData()

Returns

ObjectAttachmentData

A reference to the ObjectAttachmentData structure containing the attachment information.

GetCameraCollision()

Gets whether the object has camera collision enabled.

bool GetCameraCollision()

Returns

bool

true if the object has camera collision enabled; otherwise, false.

GetDrawDistance()

Gets the draw distance of the object.

float GetDrawDistance()

Returns

float

The draw distance in units.

GetMaterialData(uint, out ObjectMaterialData?)

Gets the material data for a specific material index on the object.

bool GetMaterialData(uint materialIndex, out ObjectMaterialData? output)

Parameters

materialIndex uint

The index of the material to retrieve.

output ObjectMaterialData

When the method returns, contains the material data if successful; otherwise, null.

Returns

bool

true if the material data was retrieved successfully; otherwise, false.

GetModel()

Gets the model ID of the object.

int GetModel()

Returns

int

The model ID of the object.

GetMovingData()

Gets the current movement data of the object.

ref ObjectMoveData GetMovingData()

Returns

ObjectMoveData

A reference to the ObjectMoveData structure containing the movement information.

IsMoving()

Checks if the object is currently moving.

bool IsMoving()

Returns

bool

true if the object is moving; otherwise, false.

Move(ref ObjectMoveData)

Moves the object to a new position and rotation over a specified time.

void Move(ref ObjectMoveData data)

Parameters

data ObjectMoveData

The movement data containing the target position, rotation, and time.

ResetAttachment()

Resets the object's attachment, removing it from any vehicle or object it was attached to.

void ResetAttachment()

SetCameraCollision(bool)

Sets whether the object has camera collision enabled.

void SetCameraCollision(bool collision)

Parameters

collision bool

true to enable camera collision; otherwise, false.

SetDrawDistance(float)

Sets the draw distance for the object.

void SetDrawDistance(float drawDistance)

Parameters

drawDistance float

The draw distance in units.

SetMaterial(uint, int, string, string, Colour)

Sets the material for a specific material index on the object.

void SetMaterial(uint materialIndex, int model, string textureLibrary, string textureName, Colour colour)

Parameters

materialIndex uint

The index of the material to set.

model int

The model ID to use for the texture library.

textureLibrary string

The texture library (TXD) name.

textureName string

The texture name from the library.

colour Colour

The colour to apply to the material.

SetMaterialText(uint, string, ObjectMaterialSize, string, int, bool, Colour, Colour, ObjectMaterialTextAlign)

Sets text material on a specific material index of the object.

void SetMaterialText(uint materialIndex, string text, ObjectMaterialSize materialSize, string fontFace, int fontSize, bool bold, Colour fontColour, Colour backgroundColour, ObjectMaterialTextAlign align)

Parameters

materialIndex uint

The index of the material to set text on.

text string

The text to display on the material.

materialSize ObjectMaterialSize

The size of the material.

fontFace string

The font face to use for the text.

fontSize int

The font size for the text.

bold bool

true to make the text bold; otherwise, false.

fontColour Colour

The colour of the text.

backgroundColour Colour

The background colour of the material.

align ObjectMaterialTextAlign

The text alignment on the material.

SetModel(int)

Sets the model ID of the object.

void SetModel(int model)

Parameters

model int

The model ID of the object.

Stop()

Stops the object's current movement.

void Stop()