GetEffectSpeed: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
{{New items|4.0132|1.4 r6208| | {{New items|4.0132|1.4 r6208| | ||
This function gets the speed | This function gets the speed of a specified [[effect]]. | ||
}} | }} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
float | float getEffectSpeed ( effect theEffect ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''tehEffect:''' The [[effect]] to get the speed of. | ||
===Returns=== | |||
Returns [[float]] containing the effect's speed, ''false'' if invalid arguments were specified. | |||
===Example=== | ===Example=== | ||
This example adds command ''ges'' that creates crate explosion effect at the player's position and outputs its speed to the chatbox. | |||
<syntaxhighlight lang="lua">[Lua] | <syntaxhighlight lang="lua">[Lua] | ||
addCommandHandler("ges", | addCommandHandler("ges", | ||
function (cmd) | function (cmd) | ||
local x, y, z = getElementPosition (localPlayer) | local x, y, z = getElementPosition(localPlayer) | ||
local effect = createEffect ("explosion_crate", x, y, z) | local effect = createEffect("explosion_crate", x, y, z) | ||
getEffectSpeed (effect) | outputChatBox("The speed: " .. tostring(getEffectSpeed(effect))) | ||
end) | end) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{Client_Effects_functions}} | {{Client_Effects_functions}} | ||
[[ru:getEffectSpeed]] | [[ru:getEffectSpeed]] |
Revision as of 11:08, 30 June 2014
Syntax
float getEffectSpeed ( effect theEffect )
Required Arguments
- tehEffect: The effect to get the speed of.
Returns
Returns float containing the effect's speed, false if invalid arguments were specified.
Example
This example adds command ges that creates crate explosion effect at the player's position and outputs its speed to the chatbox.
[Lua] addCommandHandler("ges", function (cmd) local x, y, z = getElementPosition(localPlayer) local effect = createEffect("explosion_crate", x, y, z) outputChatBox("The speed: " .. tostring(getEffectSpeed(effect))) end)