GetEffectSpeed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
(Added OOP syntax)
Line 9: Line 9:
float getEffectSpeed ( effect theEffect )
float getEffectSpeed ( effect theEffect )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[effect]]:getSpeed|speed|setEffectSpeed}}


===Required Arguments===  
===Required Arguments===  

Revision as of 16:41, 26 November 2014

ADDED/UPDATED IN VERSION 1.4 r6208 :

This function gets the speed of a specified effect.

Syntax

float getEffectSpeed ( effect theEffect )

OOP Syntax Help! I don't understand this!

Method: effect:getSpeed(...)
Variable: .speed
Counterpart: setEffectSpeed


Required Arguments

  • theEffect: 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)

See also