OnPlayerMarkerHit: Difference between revisions
Jump to navigation
Jump to search
JonChappell (talk | contribs) No edit summary |
(Many errors) |
||
(10 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
[[ | __NOTOC__ | ||
{{Server event}} | |||
This event is triggered when a [[player]] hits a [[marker]]. | |||
{{Note|This event is triggered for <b>players</b> only. Attaching this event to a marker does nothing.}} | |||
==Parameters== | |||
== | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
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 | This example outputs when a player hits a marker. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler('onPlayerMarkerHit', root, function(marker, matchingDimension) | |||
if not matchingDimension then return end -- checks if the dimension of the player who activated the marker is the same as the one the marker is in (in this case, if not, it will stop here) | |||
-- | outputChatBox('You have just entered a marker!', source, 255, 255, 0) -- output something | ||
end) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{See also/Server event|Player events}} |
Latest revision as of 14:54, 6 July 2024
This event is triggered when a player hits a marker.
Parameters
marker markerHit, bool matchingDimension
- markerHit: the marker the player hit.
- matchingDimension: a boolean representing whether the player and the hit marker are in the same dimension.
Source
The source of this event is the player that hit the marker.
Example
This example outputs when a player hits a marker.
addEventHandler('onPlayerMarkerHit', root, function(marker, matchingDimension) if not matchingDimension then return end -- checks if the dimension of the player who activated the marker is the same as the one the marker is in (in this case, if not, it will stop here) outputChatBox('You have just entered a marker!', source, 255, 255, 0) -- output something end)
See Also
Player events
- onPlayerACInfo
- onPlayerBan
- onPlayerChangeNick
- onPlayerChat
- onPlayerClick
- onPlayerCommand
- onPlayerConnect
- onPlayerContact
- onPlayerDamage
- onPlayerJoin
- onPlayerLogin
- onPlayerLogout
- onPlayerMarkerHit
- onPlayerMarkerLeave
- onPlayerModInfo
- onPlayerMute
- onPlayerNetworkStatus
- onPlayerPickupHit
- onPlayerPickupLeave
- onPlayerPickupUse
- onPlayerPrivateMessage
- onPlayerQuit
- onPlayerScreenShot
- onPlayerSpawn
- onPlayerStealthKill
- onPlayerTarget
- onPlayerUnmute
- onPlayerVehicleEnter
- onPlayerVehicleExit
- onPlayerVoiceStart
- onPlayerVoiceStop
- onPlayerWasted
- onPlayerWeaponFire
- onPlayerWeaponSwitch
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled