GetMarkerType: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(replaced the example)
Line 1: Line 1:
__NOTOC__
__NOTOC__
This function returns an type for a marker.
This function returns a marker's type.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">string getMarkerType ( marker theMarker)</syntaxhighlight>
<syntaxhighlight lang="lua">string getMarkerType ( marker theMarker )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
Line 9: Line 9:


===Returns===
===Returns===
Returns ''false'' if the marker passed is invalid or a string containing one of the following:
Returns ''false'' if the marker passed is invalid, or one of the following strings:
* '''"checkpoint"''': Checkpoint
{{Marker_types}}
* '''"ring"''': Ring (doughnut-shaped)
* '''"cylinder"''': Cylinder
* '''"arrow"''': Animated arrow pointing down
* '''"corona"''': Glowing area


==Example==
==Example==
<syntaxhighlight lang="lua">marker = createMarker ( 1000, 1000,1000, 0, 255, 0, 0 )
This function creates a default marker at a given position and outputs its type.
gettype = getMarkerType (marker)
<syntaxhighlight lang="lua">
outputChatBox ( "Its a " .. gettype .. " marker!" )
function createMarkerAndOutputType ( x, y, z )
-- we create the marker
local theMarker = createMarker ( x, y, z )
-- then get its type,
local markerType = getMarkerType (marker)
-- output it,
outputChatBox ( "It's a " .. markerType .. " marker!" )
-- and return the created marker element where this function was called
return theMarker
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Marker functions}}
{{Marker functions}}

Revision as of 12:55, 22 April 2007

This function returns a marker's type.

Syntax

string getMarkerType ( marker theMarker )

Required Arguments

  • theMarker: A marker element referencing the specified marker.

Returns

Returns false if the marker passed is invalid, or one of the following strings:

    • "checkpoint": A race checkpoint. These are very tall, but not infinite, light pillars. Checkpoints snap to ground and become invisible after going over a certain Z height.
    • "ring": Doughnut shaped ring, normally used for aircraft.
    • "cylinder": Small glowing ground ring. These are the glow markers you walk into to activate missions or events in single player.
    • "arrow": Arrow pointing down. These are the arrows on the doors you can enter in single player, except MTA's are not animated by default.
    • "corona": A glowing ball of light.

Example

This function creates a default marker at a given position and outputs its type.

function createMarkerAndOutputType ( x, y, z )
	-- we create the marker
	local theMarker = createMarker ( x, y, z )
	-- then get its type,
	local markerType = getMarkerType (marker)
	-- output it,
	outputChatBox ( "It's a " .. markerType .. " marker!" )
	-- and return the created marker element where this function was called
	return theMarker
end

See Also