GetObjectModel

From Multi Theft Auto: Wiki
Revision as of 15:44, 13 August 2006 by Aeron (talk | contribs) (→‎Example)
Jump to navigation Jump to search

This function retrieves the model ID of a specified object

Syntax

int getObjectModel ( element object )       

Required Arguments

  • object: The object which you wish to retrieve the model ID of

Returns

Returns an integer of the object ID.

Example

This example destroys a haystack when a player targets it

addEventHandler ( "onPlayerTargeted", root, "onPlayerTargeted" )
function onPlayerTargeted ( element )
    if ( getElementType ( element ) == "object" ) and ( getObjectModel ( element ) == 3374 ) then
        destroyElement ( element )
    end
end      

See Also