Skip to content

Commit 5b19f14

Browse files
committed
Minor fixes (element functions)
1 parent 22b4b8c commit 5b19f14

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

functions/Element/attachElements.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
shared: &shared
22
name: attachElements
3-
description: This function attaches one [[element]] to another, so that the first one follows the second whenever it moves.
3+
description: This function attaches one [[element]] to another, so that the first one follows the second whenever it moves. Supported element types are [[ped]], [[player]], [[blip]], [[vehicle]], [[object]], [[marker]], [[pickup]], [[sound]], [[colshape]], [[weapon]], [[camera]], [[light]].
4+
server:
45
parameters:
56
- name: theElement
67
type: element
@@ -56,8 +57,6 @@ shared: &shared
5657
occur if all rotation offsets are non-zero. (i.e. Try to ensure at least one
5758
of `xRotOffset`, `yRotOffset` or `zRotOffset` is zero).
5859
- If an attempt is made to attach two elements that are already attached the opposite way (eg `theElement` becomes `theAttachToElement` and vice versa), the 1st attachment order is automatically detached in favor of the 2nd attachment order. For example, if carA was attached to carB, now carB is attached to carA. Also, an element cannot be attached to two separate elements at one time. For example, two cars can be attached to one single car, but one single car cannot be attached to two separate cars. If you attempt to do this, the existing attachment will automatically be dropped in favor of the new attachment. For example, if carA is asked to attached to carB then carC, it is only attached to carC.
59-
- This is not compatible with all elements. The following elements are compatible: [[ped]], [[player]], [[blip]], [[vehicle]], [[object]], [[marker]], [[pickup]], [[sound]], [[colshape]], [[weapon]], [[camera]], [[light]].
60-
server:
6160
<<: *shared
6261
examples:
6362
- path: examples/attachElements-1.lua

functions/Element/detachElements.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ shared:
99
type: element
1010
description: The element you wish to detach from, will detach from the attached
1111
element if this isn't specified.
12+
default: nil
1213
examples:
1314
- path: examples/detachElements-1.lua
1415
description: 'This example attaches a marker to a vehicle, and detaches it when it blows up.'

functions/Element/examples/detachElements_OOP-1.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function freeElement(theElement)
22
if (theElement.attached) then -- If the specified element is attached to something
3-
theElement.attached:detach() -- Detach it.
3+
theElement:detach() -- Detach it.
44
else
55
outputChatBox("Element is not attached") -- If not, say it wasn't attached in the first place.
66
end

web/src/pages/reference/attachElementsOffsets.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,8 @@ end
8181

8282
<SeeAlsoSection seeAlsoLinks={getSeeAlsoLinksFromList([
8383
'reference:Element',
84-
'reference:setElementData',
85-
'reference:getElementData',
86-
'reference:getAllElementData',
87-
'reference:removeElementData',
88-
'reference:addElementDataSubscriber',
89-
'reference:hasElementDataSubscriber',
90-
'reference:removeElementDataSubscriber',
91-
'reference:onElementDataChange',
92-
'reference:onClientElementDataChange',
93-
'reference:onPlayerChangesProtectedData',
84+
'reference:attachElements',
85+
'reference:setElementAttachedOffsets',
9486
])} currentId='' />
9587

9688
</AutoStarlightPage>

0 commit comments

Comments
 (0)