ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getElementType

Function

getElementType

Server and clientElementsIdentical to MTA:SA

Returns the element type, e.g. "player", "vehicle", "ped", "object". GUI elements have types prefixed with "gui-".

Syntax

string getElementType(element theElement)

Arguments

theElementelement
The element.

Returns

The type or false.

Example

addEventHandler("onPlayerDamage", root, function(attacker)
    if attacker and getElementType(attacker) == "vehicle" then
        outputChatBox("Potrącił cię pojazd!", source)
    end
end)