FxAddGlass: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(9 intermediate revisions by 6 users not shown)
Line 6: Line 6:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool fxAddGlass ( float posX, float posY, float posZ, [int colorR=255, int colorG=0, int colorB=0, int colorA=255, float scale=1.0, int count=1] )
bool fxAddGlass ( float posX, float posY, float posZ [, int colorR = 255, int colorG = 0, int colorB = 0, int colorA = 255, float scale = 1.0, int count = 1 ] )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[Effect]].addGlass}}


===Required Arguments===  
===Required Arguments===  
Line 23: Line 24:
Returns a true if the operation was successful, false otherwise.  
Returns a true if the operation was successful, false otherwise.  


==Example==
==Examples==
This page lacks an example
This example creates a glass particle effect at the position of the player who use /addGlass command.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">function addGlassParticle(cmd,r,g,b,a,scale,count)
--add an example here
  if r and g and b then
      local x,y,z = getElementPosition(localPlayer)
      fxAddGlass(x+3,y,z,r,g,b,255,1.0,5)
  end
end
addCommandHandler("addGlass",addGlassParticle)
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Client Effects functions}}
{{Client Effects functions}}
[[Category:Needs_Example]]

Latest revision as of 10:00, 21 June 2019

Glass

This function creates a glass particle effect.

Syntax

bool fxAddGlass ( float posX, float posY, float posZ [, int colorR = 255, int colorG = 0, int colorB = 0, int colorA = 255, float scale = 1.0, int count = 1 ] )

OOP Syntax Help! I don't understand this!

Method: Effect.addGlass(...)


Required Arguments

  • posX: A float representing the x position of the glass
  • posY: A float representing the y position of the glass
  • posZ: A float representing the z position of the glass

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • colorR, colorG, colorB, colorA: the color and alpha (transparency) of the glass effect.
  • scale: A float representing the size of the particle effect, where 1 is the standard size.
  • count: The density of the particle effect.

Returns

Returns a true if the operation was successful, false otherwise.

Examples

This example creates a glass particle effect at the position of the player who use /addGlass command.

function addGlassParticle(cmd,r,g,b,a,scale,count)
   if r and g and b then 
      local x,y,z = getElementPosition(localPlayer)
      fxAddGlass(x+3,y,z,r,g,b,255,1.0,5)
   end 
end
addCommandHandler("addGlass",addGlassParticle)

See Also