- Documentation
- Client events
- onClientMarkerHit
Event
onClientMarkerHit
An element entered a marker, in this game. Works for markers from the server and ones created on the client. Players, vehicles, peds, objects, pickups and other markers are checked every 100 ms. A checkpoint marker is a circle with no height limit, the other types are a sphere with a radius equal to the marker size.
Handler
addEventHandler("onClientMarkerHit", root, function(hitElement, matchingDimension) ... end)Parameters
hitElementelement- The element that entered.
matchingDimensionbool- Whether the element and the marker are in the same dimension.
Source
source is the marker.
Example
local shop = createMarker(2500, -1660, 12.5, "cylinder", 1.5, 255, 122, 34)
addEventHandler("onClientMarkerHit", shop, function(el, dim)
if el == localPlayer and dim then outputChatBox("Sklep: wpisz /kup") end
end)
See also
onClientMarkerLeaveAn element left a marker, in this game. It also happens when the element disappears or is moved out of the marker.onClientPlayerMarkerHitA player entered a marker, in this game. The same asonClientMarkerHit, but the source is the player, so you can attach the handler tolocalPlayer.createMarkerCreates a marker in the world: a coloured cylinder to step into (e.g. a job entrance), an arrow above a spot, a corona or a ring. When a player enters it, the server firesonMarkerHitwith the player as the first argument, andonMarkerLeaveon exit. Types:"cylinder","checkpoint","arrow","corona"(a soft ball of light facing the camera),"ring". The size is the diameter in metres.