setMarkerType | Multi Theft Auto: Wiki Skip to content

setMarkerType

Client-side
Server-side
Shared

Pair: getMarkerType

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function changes a marker's type. The type controls how the marker is displayed in the game. It's important that you use marker types that users are used to from the single player game. For example, checkpoints are used in races, rings are used for aircraft races, arrows are used for entering buildings etc.

Syntax

setMarkerType ( )

Code Examples

server

This function changes all existing markers' type to the specified one.

function changeAllMarkersType ( newMarkerType )
-- we store a table with all markers
local allMarkers = getElementsByType( "marker" )
-- for each marker in it,
for index, aMarker in ipairs(allMarkers) do
-- set its type to the one passed to this function
setMarkerType( aMarker, newMarkerType )
end
end