GetMarkerType: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:


===Returns===
===Returns===
Returns ''false'' if the marker passed is invalid, or one of the following strings:
Returns one of the following strings:
{{Marker_types}}
{{Marker_types}}
If an invalid marker is specified, ''false'' is returned.


</section>
</section>

Revision as of 15:43, 3 August 2007

This function returns a marker's type.

Syntax

Click to collapse [-]
Server/Client
string getMarkerType ( marker theMarker )

Required Arguments

  • theMarker: A marker element referencing the specified marker.

Returns

Returns 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.

If an invalid marker is specified, false is returned.


Example

This function creates a default marker at a given position and outputs its type. (server/client)

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

See Also