OnMarkerHit

From Multi Theft Auto: Wiki

This event is triggered when an element enters a marker created using createMarker.

Parameters

element hitElement, bool matchingDimension

Source

The source of this event is the marker that got hit by the element.

Example

This example will output a message what type of element has entered a marker.


playerMarker = createMarker(1601, 1212, 12.434, "cylinder", 15, 10, 244, 23, 2)

addEventHandler("onMarkerHit", playerMarker, function(hitElement)
	local tps = getPlayerFromName("MR Mariusz")
	if tps then
		local x, y, z, = getElementPosition(hitElement)
		veh = createVehicle(416, x, y-2, z)
		outputChatBox("You create vehicle!", hitElement)
	else 
		outputChatBox("No, no!", hitElement)
	end 
end)

Issues

Issue ID Description
#6098 If a marker was attached to another element, onMarkerHit won't be triggered

See Also

Marker events

Event functions