FxCreateParticle
Jump to navigation
Jump to search
Syntax
bool fxCreateParticle(string particle, float posX, float posY, float posZ, float dirX, float dirY, float dirZ, float r, float g, float b, float a [, bool randomizeColors = false, int count = 1, float brightness = 1.0, float size = 0.3, bool randomSizes = false, float life = 1.0 ])
OOP Syntax Help! I don't understand this!
- Method: Effect.createParticle(...)
Required Arguments
- particle: The name of the particle to create. See particles list.
- posX, posY, posZ: the world coordinates where the effect originates.
- dirX, dirY, dirZ: a direction vector indicating where the particles flies to.
- r, g, b, a: a particle color.
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.
- randomizeColors: Specifies whether the color should be fixed (r,g,b) or randomly calculated for each particle based on the given color. This allows to create colorful effects.
- count: the number of flying particles to create. Depending on the particle, a very large count may cause the game to lag or freeze (50k+).
- brightness: the brightness. Ranges from 0 (almost black) to 1 (normal color).
- size: Particles size. If randomSizes is set then when 0 is specified the minimum size is 0.3.
- randomSizes: Specifies whether all particles should be the same fixed size or each particle should have a random size.
- life: the higher this value, the longer the particles survive before they disappear. This parameter may be ignored by some particles.
Example
Click to collapse [-]
ClientThis example creates a constant green, toxic fume over the biowell.
setTimer(function() fxCreateParticle("sand", 1271.76392, 295.11682, 20.65631, 0, 0, 1, 56, 191, 52, 255, false, 5, 1, 1, true) end, 750, 0)
See Also
- createEffect
- fxAddBlood
- fxAddBulletImpact
- fxAddBulletSplash
- fxAddDebris
- fxAddFootSplash
- fxAddGlass
- fxAddGunshot
- fxAddPunchImpact
- fxAddSparks
- fxAddTankFire
- fxAddTyreBurst
- fxAddWaterHydrant
- fxAddWaterSplash
- fxAddWood
- getEffectDensity
- getEffectSpeed
- setEffectDensity
- setEffectSpeed