onClientMarkerHit | Multi Theft Auto: Wiki Skip to content

onClientMarkerHit

Client-side
Server-side
Shared

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

The event is not triggered when only the dimension changes of the player. So, if you use the matchingDimension when teleporting players into existing markers you should always first set their dimension/interior and only then the position

Parameters

player hitPlayer, bool matchingDimension
  • hitPlayer: the player that hit the marker.
  • matchingDimension: true if the player is in the same dimension as the hit marker.

Source

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

Code Examples

client

This code will output a message to the chatbox whenever any player walks into any marker.

function MarkerHit ( hitPlayer, matchingDimension )
outputChatBox ( getPlayerName(hitPlayer) .. " entered a marker" )
end
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit )