FxAddGlass: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Cleaned up examples) |
||
Line 23: | Line 23: | ||
Returns a true if the operation was successful, false otherwise. | Returns a true if the operation was successful, false otherwise. | ||
== | ==Examples== | ||
<section name="Client" class="client" show="true"> | |||
This example shows you how to add a command to add glass effect. | This example shows you how to add a command to add glass effect. | ||
<syntaxhighlight lang="lua">function addGlassParticle(r,g,b,a,scale,count) | <syntaxhighlight lang="lua">function addGlassParticle(r,g,b,a,scale,count) | ||
Line 31: | Line 33: | ||
addCommandHandler("addGlass",addGlassParticle) | addCommandHandler("addGlass",addGlassParticle) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
<section name="Client" class="client" show="true"> | |||
This example shows you how to add a glass effect to a map | This example shows you how to add a glass effect to a map | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 40: | Line 44: | ||
addEventHandler("onResourceStart",getResourceRootElement(getThisResource(), addPG) | addEventHandler("onResourceStart",getResourceRootElement(getThisResource(), addPG) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Client Effects functions}} | {{Client Effects functions}} |
Revision as of 12:14, 25 May 2012
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] )
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
Click to collapse [-]
ClientThis example shows you how to add a command to add glass effect.
function addGlassParticle(r,g,b,a,scale,count) x,y,z = getElementPosition(localPlayer) fxAddGlass(x+3,y,z,r,g,b,a,scale,count) end addCommandHandler("addGlass",addGlassParticle)
Click to collapse [-]
ClientThis example shows you how to add a glass effect to a map
function addPG() fxAddGlass(0,0,0,134,231,231,1,random(30,40)) end addEventHandler("onResourceStart",getResourceRootElement(getThisResource(), addPG)
See Also
- createEffect
- fxAddBlood
- fxAddBulletImpact
- fxAddBulletSplash
- fxAddDebris
- fxAddFootSplash
- fxAddGlass
- fxAddGunshot
- fxAddPunchImpact
- fxAddSparks
- fxAddTankFire
- fxAddTyreBurst
- fxAddWaterHydrant
- fxAddWaterSplash
- fxAddWood
- getEffectDensity
- getEffectSpeed
- setEffectDensity
- setEffectSpeed