SetElementVelocity: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This function sets the velocity (movement speeds) along each axis, for an element. | |||
This function sets the velocity (movement speeds) along each axis, | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setElementVelocity ( element theElement, float speedX, speedY, speedZ )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setElementVelocity ( element theElement, float speedX, float speedY, float speedZ )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
Line 11: | Line 10: | ||
*'''speedY''': A floating point value determining the speed along the Y 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. | *'''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== | ==Example== | ||
This example 'copies' the speed of a specific player (called ''someguy'' in this example) to another player (called ''Ted'' in this example). | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
speedx, speedy, speedz = getElementVelocity ( findPlayer ( "someguy" ) ) -- get the velocity of the player named "someguy" | speedx, speedy, speedz = getElementVelocity ( findPlayer ( "someguy" ) ) -- get the velocity of the player named "someguy" |
Revision as of 09:49, 24 July 2006
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 ( findPlayer ( "someguy" ) ) -- get the velocity of the player named "someguy" setElementVelocity ( findPlayer ( "Ted" ), speedx, speedy, speedz ) -- copy the velocity to a player named "Ted"
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState