IsElementDoubleSided: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
mNo edit summary  | 
				No edit summary  | 
				||
| Line 1: | Line 1: | ||
{{Server client function}}  | {{Server client function}}  | ||
__NOTOC__  | __NOTOC__  | ||
This function checks whether an element is double-sided as set by [[setElementDoubleSided]] or not.  | This function checks whether an element is double-sided as set by [[setElementDoubleSided]] or not.  | ||
| Line 16: | Line 15: | ||
==Example==  | ==Example==  | ||
This example checks if the object created is breakable and if it is then breaks it.  | |||
<section name="Server" class="server" show="true">  | |||
<syntaxhighlight lang="lua">  | <syntaxhighlight lang="lua">  | ||
--  | addCommandHandler("createObj",  | ||
function(plr, command, id)  | |||
    local x, y, z = getElementPosition(plr)  | |||
    local object = createObject (id, x, y, z)  | |||
    if (isElementDoubleSided(object)) then  -- checks if it is double sided or not  | |||
       outputChatBox("The object is double sided", plr)  | |||
    else  | |||
       outputChatBox("The object is not double sided", plr)  | |||
    end  | |||
end  | |||
)  | |||
</syntaxhighlight>  | </syntaxhighlight>  | ||
</section>  | |||
==See Also==  | ==See Also==  | ||
{{Element functions}}  | {{Element functions}}  | ||
Revision as of 18:52, 18 January 2014
This function checks whether an element is double-sided as set by setElementDoubleSided or not.
Syntax
bool isElementDoubleSided ( element theElement )
Required Arguments
- theElement: The element in which you'd like to check the double-sidedness of.
 
Returns
Returns true if the theElement is double-sided, false otherwise.
Example
This example checks if the object created is breakable and if it is then breaks it.
Click to collapse [-]
ServeraddCommandHandler("createObj",
function(plr, command, id)
    local x, y, z = getElementPosition(plr)
    local object = createObject (id, x, y, z)
    if (isElementDoubleSided(object)) then  -- checks if it is double sided or not
       outputChatBox("The object is double sided", plr)
    else
       outputChatBox("The object is not double sided", plr)
    end
end
)
See Also
- attachElements
 - createElement
 - destroyElement
 - detachElements
 - getAttachedElements
 - getElementAlpha
 - getElementAttachedOffsets
 - getElementAttachedTo
 - getElementByIndex
 - getElementByID
 - getElementChild
 - getElementChildren
 - getElementChildrenCount
 - getElementCollisionsEnabled
 - getElementColShape
 - getElementData
 - getAllElementData
 - hasElementData
 - getElementDimension
 - getElementHealth
 - getElementID
 - getElementInterior
 - getElementMatrix
 - getElementModel
 - getElementParent
 - getElementPosition
 - getElementRotation
 - getElementsByType
 - getElementsWithinColShape
 - getElementsWithinRange
 - getElementType
 - getElementVelocity
 - getLowLODElement
 - getRootElement
 - isElement
 - isElementAttached
 - isElementCallPropagationEnabled
 - isElementDoubleSided
 - isElementFrozen
 - isElementInWater
 - isElementLowLOD
 - isElementWithinColShape
 - isElementWithinMarker
 - setElementAlpha
 - setElementAngularVelocity
 - getElementAngularVelocity
 - setElementAttachedOffsets
 - setElementCallPropagationEnabled
 - setElementCollisionsEnabled
 - setElementData
 - setElementDimension
 - setElementDoubleSided
 - setElementFrozen
 - setElementHealth
 - setElementID
 - setElementInterior
 - setElementModel
 - setElementParent
 - setElementPosition
 - setElementRotation
 - setElementVelocity
 - setLowLODElement
 - getPedContactElement
 - getResourceDynamicElementRoot
 - getResourceRootElement