OnPlayerMarkerHit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Incomplete Event]]
__NOTOC__
{{Server event}}
This event is triggered when a [[player]] hits a [[marker]].


__NOTOC__
==Parameters==
This event is blahblah and is used for blahblah.
 
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
void onPlayerMarkerHit ( marker hitmarker, bool matchingDimension )   
marker markerHit, bool matchingDimension
</syntaxhighlight>  
</syntaxhighlight>  
*'''markerHit''': the [[marker]] the [[player]] hit.
*'''matchingDimension''': a [[boolean]] representing whether the [[player]] and the hit [[marker]] are in the same [[dimension]].
==Source==
The [[event system#Event source|source]] of this event is the [[player]] that hit the marker.


==Example==  
==Example==  
This example does...
This example outputs when a player hits a marker.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function markerAlert(markerHit,matchingDimension)
blabhalbalhb --abababa
if (matchingDimension) then -- Make sure the player is in the same dimension as the marker (so they're actually going into it).
--This line does this...
outputChatBox("You have just entered a marker.",source,255,255,0) -- Output that they are.
mooo
end
end
addEventHandler("onPlayerMarkerHit",getRootElement(),markerAlert)
</syntaxhighlight>
</syntaxhighlight>
{{See also/Server event|Player events}}

Revision as of 03:01, 27 September 2018

This event is triggered when a player hits a marker.

Parameters

marker markerHit, bool matchingDimension

Source

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

Example

This example outputs when a player hits a marker.

function markerAlert(markerHit,matchingDimension)
	if (matchingDimension) then -- Make sure the player is in the same dimension as the marker (so they're actually going into it).
		outputChatBox("You have just entered a marker.",source,255,255,0) -- Output that they are.
	end
end
addEventHandler("onPlayerMarkerHit",getRootElement(),markerAlert)

See Also

Player events


Event functions