ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getWeaponTarget

Function

getWeaponTarget

ServerWeaponsIdentical to MTA:SA

Returns a scripted weapon's target.

Syntax

mixed getWeaponTarget(weapon weapon)

Arguments

weaponweapon
The scripted weapon.

Returns

The target element or three numbers x, y, z, or false with no target.

Example

local target = getWeaponTarget(turret)
if isElement(target) then
    print("Celuje w " .. getElementType(target))
end

See also