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

Function

setSearchLightStartPosition

ServerLightsIdentical to MTA:SA

Moves the searchlight beam's source (e.g. following a helicopter).

Syntax

bool setSearchLightStartPosition(element theLight, float x, float y, float z)

Arguments

theLightelement
The searchlight.
xfloat
New X.
yfloat
New Y.
zfloat
New Z.

Returns

true on success.

Example

local heli = createVehicle(497, 2495, -1680, 40)
local light = createSearchLight(2495, -1680, 39, 2495, -1665, 13)
setTimer(function()
    local x, y, z = getElementPosition(heli)
    setSearchLightStartPosition(light, x, y, z - 1)
end, 100, 0)

See also