EngineGetModelNameFromID

From Multi Theft Auto: Wiki

This function gets the model name of an object model from model ID. This function is the counterpart of engineGetModelIDFromName.

Syntax

string engineGetModelNameFromID ( int modelID )

OOP Syntax Help! I don't understand this!

Method: Engine.getModelNameFromID(...)

Required Arguments

  • modelID: The model ID of the object

Returns

Returns a string with the name of the object model, false otherwise.

Example

This example gets the model name of an element you target (doesn't work for San Andreas world)

function getTargetModelName(target) 
    if ( isElement(target) and getElementType(target) == "object" ) then 
        outputChatBox(tostring(engineGetModelNameFromID(getElementModel(target))))
    end
end
addEventHandler("onClientPlayerTarget", localPlayer, getTargetModelName)

See Also

FROM VERSION 1.5.7 r19626 ONWARDS
FROM VERSION 1.5.7 r20147 ONWARDS