OnPlayerMarkerLeave: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (See Also for server events)
Line 15: Line 15:


==Example==  
==Example==  
<!-- Explain what the example is in a single sentance -->
This example will output the name of the player that has left a specific marker to the chatbox.
This example does...
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
-- Create our marker
blah()
marker = createMarker(1248,2012,123,"corona",7,255,255,255,255)
--This line does this...
 
mooo
function someoneLeftMarker(markerLeft,matchingDimension)
  -- Output our message
  outputChatBox(getPlayerName(source).." has left the marker!",getRootElement(),255,0,0)
end
-- Add an event handler to trigger our function
addEventHandler("onPlayerMarkerLeave",marker,someoneLeftMarker)
</syntaxhighlight>
</syntaxhighlight>


{{See also/Server event|Player events}}
{{See also/Server event|Player events}}
[[Category:Needs Example]]

Revision as of 17:30, 1 May 2011

This event is triggered when a player leaves the area of a marker.

Parameters

marker markerLeft, bool matchingDimension
  • markerLeft: The marker the player left
  • matchingDimension: Whether the player and the marker he left are in the same dimension

Source

The source of this event is the player that left the marker.

Example

This example will output the name of the player that has left a specific marker to the chatbox.

-- Create our marker
marker = createMarker(1248,2012,123,"corona",7,255,255,255,255)

function someoneLeftMarker(markerLeft,matchingDimension)
   -- Output our message
   outputChatBox(getPlayerName(source).." has left the marker!",getRootElement(),255,0,0)
end
-- Add an event handler to trigger our function
addEventHandler("onPlayerMarkerLeave",marker,someoneLeftMarker)

See Also

Player events


Event functions