Table of Contents

Interface ICustomModelsComponent.IManagedInterface

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

Represents the managed interface implemented by its unmanaged counterpart.

public interface ICustomModelsComponent.IManagedInterface : IUnmanagedInterface
Inherited Members

Methods

AddCustomModel(ModelType, int, int, string, string, int, byte, byte)

Adds a custom model to the server.

bool AddCustomModel(ModelType type, int id, int baseId, string dffName, string txdName, int virtualWorld = -1, byte timeOn = 0, byte timeOff = 0)

Parameters

type ModelType

The type of model being added.

id int

The custom model ID to assign.

baseId int

The base model ID to replace.

dffName string

The name of the DFF file.

txdName string

The name of the TXD file.

virtualWorld int

The virtual world for the model (-1 for all).

timeOn byte

Time when the model is active (hour).

timeOff byte

Time when the model is inactive (hour).

Returns

bool

true if the model was added successfully; otherwise, false.

GetBaseModel(ref uint, ref uint)

Gets the relationship between a base model and custom model.

bool GetBaseModel(ref uint baseModelIdOrInput, ref uint customModel)

Parameters

baseModelIdOrInput uint

Input/output parameter for model IDs.

customModel uint

The custom model ID.

Returns

bool

true if the mapping exists; otherwise, false.

GetCustomModelPath(int, out string?, out string?)

Gets the file paths for a custom model.

bool GetCustomModelPath(int modelId, out string? dffPath, out string? txdPath)

Parameters

modelId int

The custom model ID.

dffPath string

When the method returns, contains the DFF file path.

txdPath string

When the method returns, contains the TXD file path.

Returns

bool

true if the paths were retrieved successfully; otherwise, false.

GetEventDispatcher()

Gets the event dispatcher for custom model events.

IEventDispatcher<IPlayerModelsEventHandler> GetEventDispatcher()

Returns

IEventDispatcher<IPlayerModelsEventHandler>

The event dispatcher instance.

GetModelNameFromChecksum(uint)

Gets the model name from its checksum.

string? GetModelNameFromChecksum(uint checksum)

Parameters

checksum uint

The model checksum.

Returns

string

The model name, or null if not found.

IsValidCustomModel(int)

Checks whether a model ID is a valid custom model.

bool IsValidCustomModel(int modelId)

Parameters

modelId int

The model ID to check.

Returns

bool

true if the model is a valid custom model; otherwise, false.