GetMarkerType: Difference between revisions

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


==Syntax==
==Syntax==
<section name="Server" class="server">
<syntaxhighlight lang="lua">string getMarkerType ( marker theMarker )</syntaxhighlight>
<syntaxhighlight lang="lua">string getMarkerType ( marker theMarker )</syntaxhighlight>


Line 11: Line 12:
Returns ''false'' if the marker passed is invalid, or one of the following strings:
Returns ''false'' if the marker passed is invalid, or one of the following strings:
{{Marker_types}}
{{Marker_types}}
</section>
<section name="Client" class="client">
<syntaxhighlight lang="lua">string getMarkerType ( marker theMarker )</syntaxhighlight>
===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:
{{Marker_types}}
</section>


==Example==
==Example==

Revision as of 12:28, 3 August 2007

This function returns a marker's type.

Syntax

Click to expand [+]
Server
Click to expand [+]
Client

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 )
	-- 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