Interface ICustomModelsService
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
typeModelTypeThe custom model type.
idintThe custom model ID to assign.
baseIdintThe base GTA model ID to replace.
dffNamestringThe DFF (mesh) file name.
txdNamestringThe TXD (texture archive) file name.
virtualWorldintThe virtual world (-1 for all).
timeOnbyteThe hour at which the model becomes visible.
timeOffbyteThe hour at which the model is hidden.
Returns
GetBaseModel(uint)
Resolves a custom model ID to its base GTA model.
uint? GetBaseModel(uint customModelId)
Parameters
customModelIduintThe custom model ID.
Returns
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
modelIdintThe custom model ID.
dffPathstringWhen this method returns, contains the DFF path or null.
txdPathstringWhen this method returns, contains the TXD path or null.
Returns
GetModelNameFromChecksum(uint)
Looks up a model name by its open.mp checksum.
string? GetModelNameFromChecksum(uint checksum)
Parameters
checksumuintThe model checksum.
Returns
IsValidCustomModel(int)
Checks whether the given model ID refers to a registered custom model.
bool IsValidCustomModel(int modelId)
Parameters
modelIdintThe model ID.