EngineGetModelIDFromName: Difference between revisions
Jump to navigation
Jump to search
(add oop syntax) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function gets the model ID of an object model from object name. This function is the | This function gets the model ID of an object model from object name. This function is the counterpart of [[engineGetModelNameFromID]]. | ||
==Syntax== | ==Syntax== |
Latest revision as of 12:30, 6 July 2018
This function gets the model ID of an object model from object name. This function is the counterpart of engineGetModelNameFromID.
Syntax
int engineGetModelIDFromName ( string modelName )
OOP Syntax Help! I don't understand this!
- Method: Engine.getModelIDFromName(...)
Required Arguments
- modelName: The model name of the object
Returns
Returns an int with the ID of the object model, false otherwise.
Example
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))) end end addEventHandler("onClientPlayerTarget", localPlayer, getTargetModelNameAndID)
See Also
- engineAddImage
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineGetModelFlags
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDID
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFilesCount
- engineImageGetFiles
- engineImageGetFile
- engineImageLinkDFF
- engineImageLinkTXD
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIMG
- engineLoadIFP
- engineLoadTXD
- engineRemoveImage
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineResetModelFlags
- engineResetModelLODDistance
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImage
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImage
- engineRestreamWorld
- engineSetAsynchronousLoading
- engineSetModelFlag
- engineSetModelFlags
- engineSetModelLODDistance
- engineSetModelPhysicalPropertiesGroup
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetUsedMemory