ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onElementClicked

Event

onElementClicked

ServerInput and controlsIdentical to MTA:SA

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)

See also