GetEffectDensity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Client function}}
{{New items|4.0132|1.4 r6208|
{{New items|3.014|1.4 r6208|
This function gets the level of density the effect.
This function gets the density of certain [[effect]].
}}
}}


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
float getEffectDensity( effect theEffect )
float getEffectDensity ( effect theEffect )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[effect]]:getDensity|density|setEffectDensity}}


===Required Arguments===  
===Required Arguments===  
*'''effect:''' The name of the [[Element/Effect#Effects_list|effect]].
*'''theEffect:''' The [[effect]] to get density of.


===Example===
===Example===
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">[Lua]
addCommandHandler("ses",  
addCommandHandler("ses",  
function (cmd)
function (cmd)
Line 25: Line 25:
end)
end)
</syntaxhighlight>
</syntaxhighlight>
</section>


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

Latest revision as of 13:55, 7 May 2017

This function gets the density of certain effect.

Syntax

float getEffectDensity ( effect theEffect )

OOP Syntax Help! I don't understand this!

Method: effect:getDensity(...)
Variable: .density
Counterpart: setEffectDensity


Required Arguments

  • theEffect: The effect to get density of.

Example

addCommandHandler("ses", 
function (cmd)
   local density = 4
   local x, y, z = getElementPosition (localPlayer)
   local effect = createEffect ("cement", x, y, z)
   setEffectDensity (effect, density)
   getEffectDensity (effect)
end)

See also