SetEffectSpeed: Difference between revisions

From Multi Theft Auto: Wiki
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 sets the speed for the effect.
This function sets the speed of a specified [[effect]].
}}
}}


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
void    setEffectSpeed(effect, speed)
bool setEffectSpeed ( effect theEffect, float speed )
</syntaxhighlight>
</syntaxhighlight>


===Required Arguments===  
===Required Arguments===  
*'''effect:''' The name of the [[Element/Effect#Effects_list|effect]]. For example ( "smoke30lit" ).
*'''theEffect:''' The [[effect]] to change the speed of.
*'''speed:''' The speed.
*'''speed:''' The speed to set.
 
===Returns===
Returns ''true'' if the effect speed was succesfuly changed, ''false'' otherwise.


===Example===
===Example===
<section name="Client" class="client" show="true">
This example adds command ''ses'' that creates effect of a smoke at player's position and sets its speed to 5.
<syntaxhighlight lang="lua">[Lua]
<syntaxhighlight lang="lua">[Lua]
addCommandHandler("ses",  
addCommandHandler("ses",  
function (cmd)
function (cmd)
   local x, y, z = getElementPosition (localPlayer)
   local x, y, z = getElementPosition(localPlayer)
   local effect = createEffect ("smoke30lit", x, y, z)
   local effect = createEffect("smoke30lit", x, y, z)
   setEffectSpeed (effect, 5)
   setEffectSpeed(effect, 5)
end)
end)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See also==
==See also==
{{Client_Effects_functions}}
{{Client_Effects_functions}}
[[ru:setEffectSpeed]]
[[ru:setEffectSpeed]]

Revision as of 11:01, 30 June 2014

ADDED/UPDATED IN VERSION 1.4 r6208 :

This function sets the speed of a specified effect.

Syntax

bool setEffectSpeed ( effect theEffect, float speed )

Required Arguments

  • theEffect: The effect to change the speed of.
  • speed: The speed to set.

Returns

Returns true if the effect speed was succesfuly changed, false otherwise.

Example

This example adds command ses that creates effect of a smoke at player's position and sets its speed to 5.

[Lua]
addCommandHandler("ses", 
function (cmd)
   local x, y, z = getElementPosition(localPlayer)
   local effect = createEffect("smoke30lit", x, y, z)
   setEffectSpeed(effect, 5)
end)

See also