OnClientMarkerHit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Client event}} This event is triggered when a player enters a marker created using createMarker. ==Parameters== <syntaxhighlight lang="lua"> player hitPlayer, bool matchingDimension </co...)
 
mNo edit summary
Line 21: Line 21:
outputChatBox ( getPlayerName(hitPlayer) .. " entered a marker" )
outputChatBox ( getPlayerName(hitPlayer) .. " entered a marker" )
end
end
addEventHandler ( "onMarkerHit", getRootElement(), MarkerHit )
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Client marker events}}
{{Client marker events}}

Revision as of 17:09, 8 June 2008

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

Parameters

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

Source

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

Example

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 )

See Also