Table of Contents

Interface ICustomModelsService

Namespace
SampSharp.Entities.SAMP
Assembly
SampSharp.OpenMp.Entities.dll

Provides access to the open.mp custom-models component.

public interface ICustomModelsService

Methods

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

Registers a new custom model with 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 custom model type.

id int

The custom model ID to assign.

baseId int

The base GTA model ID to replace.

dffName string

The DFF (mesh) file name.

txdName string

The TXD (texture archive) file name.

virtualWorld int

The virtual world (-1 for all).

timeOn byte

The hour at which the model becomes visible.

timeOff byte

The hour at which the model is hidden.

Returns

bool

true on success.

GetBaseModel(uint)

Resolves a custom model ID to its base GTA model.

uint? GetBaseModel(uint customModelId)

Parameters

customModelId uint

The custom model ID.

Returns

uint?

The base model ID, or null if no mapping exists.

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

Gets the on-disk paths for a custom model's DFF and TXD files.

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

Parameters

modelId int

The custom model ID.

dffPath string

When this method returns, contains the DFF path or null.

txdPath string

When this method returns, contains the TXD path or null.

Returns

bool

true on success.

GetModelNameFromChecksum(uint)

Looks up a model name by its open.mp 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 the given model ID refers to a registered custom model.

bool IsValidCustomModel(int modelId)

Parameters

modelId int

The model ID.

Returns

bool

true if it is a custom model.