SetElementVelocity: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Server client function}} | |||
{{Needs_Checking|What types of elements does it work with? [[User:Erorr404|Erorr404]]}} | {{Needs_Checking|What types of elements does it work with? [[User:Erorr404|Erorr404]]}} | ||
__NOTOC__ | __NOTOC__ | ||
Line 7: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theElement''' | *'''theElement:''' The [[element]] you wish to set the velocity of. | ||
*'''speedX''' | *'''speedX:''' A floating point value determining the speed along the X axis. | ||
*'''speedY''' | *'''speedY:''' A floating point value determining the speed along the Y axis. | ||
*'''speedZ''' | *'''speedZ:''' A floating point value determining the speed along the Z axis. | ||
===Returns=== | ===Returns=== | ||
Line 20: | Line 21: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
speedx, speedy, speedz = getElementVelocity ( getPlayerFromNick ( "someguy" ) ) -- get the velocity of the player named "someguy" | speedx, speedy, speedz = getElementVelocity ( getPlayerFromNick ( "someguy" ) ) -- get the velocity of the player named "someguy" | ||
setElementVelocity ( getPlayerFromNick ( "Ted" ), speedx, speedy, speedz ) -- copy the velocity to a player named "Ted" | setElementVelocity ( getPlayerFromNick ( "Ted" ), speedx, speedy, speedz ) -- copy the velocity to a player named "Ted" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{element functions}} | {{element functions}} |
Revision as of 11:37, 16 August 2007
This article needs checking. | |
Reason(s): What types of elements does it work with? Erorr404 |
This function sets the velocity (movement speeds) along each axis, for an element.
Syntax
bool setElementVelocity ( element theElement, float speedX, float speedY, float speedZ )
Required Arguments
- theElement: The element you wish to set the velocity of.
- speedX: A floating point value determining the speed along the X axis.
- speedY: A floating point value determining the speed along the Y axis.
- speedZ: A floating point value determining the speed along the Z axis.
Returns
Returns true if the speed was set successfully, false if a bad element was specified or other bad arguments.
Example
This example 'copies' the speed of a specific player (called someguy in this example) to another player (called Ted in this example).
speedx, speedy, speedz = getElementVelocity ( getPlayerFromNick ( "someguy" ) ) -- get the velocity of the player named "someguy" setElementVelocity ( getPlayerFromNick ( "Ted" ), speedx, speedy, speedz ) -- copy the velocity to a player named "Ted"
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