GetElementType: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Incomplete]]
__NOTOC__  
__NOTOC__  
This fake function is for use with blah & blah and does blahblahblabhalbhl
This function is used to retrieve the type of an Element.


==Syntax==  
==Syntax==  
Line 13: Line 11:


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
There are a total of 10 strings this function returns:
*'''"player":''' A player connected to the server
*'''"vehicle":''': A vehicle
*'''"object":''' An object
*'''"pickup":''' A pickup
*'''"blip":''' A blip
*'''"marker":''' A marker
*'''"spawnpoint":''' A spawnpoint
*'''"remoteclient":''' A remote client connected to the server
*'''"console":''' The server Console
*'''"unknown":''' Unknown element type


==Example==  
==Example==  

Revision as of 16:18, 13 August 2006

This function is used to retrieve the type of an Element.

Syntax

string getElementType ( element element )  

Required Arguments

  • element: The element you wish to get the type of.

Returns

There are a total of 10 strings this function returns:

  • "player": A player connected to the server
  • "vehicle":: A vehicle
  • "object": An object
  • "pickup": A pickup
  • "blip": A blip
  • "marker": A marker
  • "spawnpoint": A spawnpoint
  • "remoteclient": A remote client connected to the server
  • "console": The server Console
  • "unknown": Unknown element type

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

Elements