- Documentation
- Server events
- onElementClicked
Event
onElementClicked
A player clicked on an element (with the cursor visible).
Handler
addEventHandler("onElementClicked", root, function(theButton, theState, thePlayer, clickPosX, clickPosY, clickPosZ) ... end)Parameters
theButtonstring- The button.
theStatestring"down"or"up".thePlayerplayer- Who clicked.
clickPosX, clickPosY, clickPosZfloat- World point.
Source
source is the clicked element.
Example
addEventHandler("onElementClicked", root, function(button, state, player)
if state == "down" and getElementType(source) == "ped" then
outputChatBox("Rozmowa z NPC...", player)
end
end)