DgsAttachToAutoDestroy

From Multi Theft Auto: Wiki
Revision as of 08:20, 26 April 2020 by Temois (talk | contribs) (Created page with "__NOTOC__ {{Client function}} This function allows retrieval of a DGS element's current position, relative to its parent. ==Syntax== <syntaxhighlight lang="lua"> bool dgsAt...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function allows retrieval of a DGS element's current position, relative to its parent.

Syntax

bool dgsAttachToAutoDestroy(element, dgsElement)

Required Arguments

  • element: Element you want to attach dgsElement
  • dgsElement: dgsElement you want to attach element

Returns

Returns element attached to dgsElement

Example

This example create a vehicle attached to window, which will be destroyed after 2 seconds with window

DGS = exports.dgs

local window = dgsCreateWindow(200,200,200,200,"test",false)
local vehicle = createVehicle(411,0,0,3)
dgsAttachToAutoDestroy(vehicle,window)
setTimer(function()
    destroyElement(window)
end,2000,1)