engineGetModelIDFromName
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function gets the model ID of an object model from object name. This function is the counterpart of engineGetModelNameFromID.
OOP Syntax Help! I don't understand this!
- Method: Engine.getModelIDFromName(...)
Syntax
int engineGetModelIDFromName ( string modelName )Required Arguments
- modelName: The model name of the object
Returns
- int: value
Returns an int with the ID of the object model, false otherwise.
Code Examples
shared
This example gets the model ID and name of an element you target (doesn't work for San Andreas world)
function getTargetModelNameAndID(target) if ( isElement(target) and getElementType(target) == "object" ) then local modelName = tostring(engineGetModelNameFromID(getElementModel(target))) outputChatBox("Name: "..modelName) -- Although we could just use getElementModel(target) for this example we will use modelName outputChatBox("ID: "..tostring(engineGetModelIDFromName(modelName))) endendaddEventHandler("onClientPlayerTarget", localPlayer, getTargetModelNameAndID)See Also
Engine Functions
- engineAddClothingModel
- engineAddClothingTXD
- engineAddImage
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineFreeTXD
- engineGetModelFlags
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDID
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetPoolCapacity
- engineGetPoolDefaultCapacity
- engineGetPoolUsedCapacity
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFile
- engineImageGetFiles
- engineImageGetFilesCount
- engineImageLinkDFF
- engineImageLinkTXD
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIFP
- engineLoadIMG
- engineLoadTXD
- enginePreloadWorldArea
- engineRemoveImage
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineRequestTXD
- engineResetModelFlags
- engineResetModelLODDistance
- engineResetModelTXDID
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImage
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImage
- engineRestreamWorld
- engineSetAsynchronousLoading
- engineSetModelFlag
- engineSetModelFlags
- engineSetModelLODDistance
- engineSetModelPhysicalPropertiesGroup
- engineSetModelTXDID
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetPoolCapacity
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetBufferSize
- engineStreamingGetMemorySize
- engineStreamingGetModelLoadState
- engineStreamingGetUsedMemory
- engineStreamingReleaseModel
- engineStreamingRequestModel
- engineStreamingRestoreBufferSize
- engineStreamingRestoreMemorySize
- engineStreamingSetBufferSize
- engineStreamingSetMemorySize
- engineStreamingSetModelCacheLimits