FxAddGunshot: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Client function}} This function creates a gunshot particle effect. ==Syntax== <syntaxhighlight lang="lua"> bool fxAddGunshot ( float posX, float posY, float posZ, float dirX, float dirY, f...) |
mNo edit summary |
||
(8 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
[[Image:Fxgunshot.png|thumb|200px|Gunshot]] | |||
This function creates a gunshot particle effect. | This function creates a gunshot particle effect. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool fxAddGunshot ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ, | bool fxAddGunshot ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ [, bool includeSparks = true ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Effect]].addGunshot}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 12: | Line 14: | ||
*'''dirX, dirY, dirZ:''' a direction vector indicating where the bullet is fired. | *'''dirX, dirY, dirZ:''' a direction vector indicating where the bullet is fired. | ||
==Optional Arguments== | ===Optional Arguments=== | ||
{{OptionalArg}} | {{OptionalArg}} | ||
* '''includeSparks:''' A bool representing whether the particle effect will generate sparks. | * '''includeSparks:''' A bool representing whether the particle effect will generate sparks. | ||
Line 20: | Line 22: | ||
==Example== | ==Example== | ||
This | <section name="Client" class="client" show="true"> | ||
This example adds a gunshot with sparks in front of your face. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("sshot", function() | |||
local x, y, z = getElementPosition(localPlayer) | |||
fxAddGunshot(x, y+0.5, z+0.5, 0, 0, 0, true) | |||
end) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Client Effects functions}} | {{Client Effects functions}} | ||
Latest revision as of 10:00, 21 June 2019
This function creates a gunshot particle effect.
Syntax
bool fxAddGunshot ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ [, bool includeSparks = true ] )
OOP Syntax Help! I don't understand this!
- Method: Effect.addGunshot(...)
Required Arguments
- posX, posY, posZ: the world coordinates where the effect originates.
- dirX, dirY, dirZ: a direction vector indicating where the bullet is fired.
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.
- includeSparks: A bool representing whether the particle effect will generate sparks.
Returns
Returns a true if the operation was successful, false otherwise.
Example
Click to collapse [-]
ClientThis example adds a gunshot with sparks in front of your face.
addCommandHandler("sshot", function() local x, y, z = getElementPosition(localPlayer) fxAddGunshot(x, y+0.5, z+0.5, 0, 0, 0, true) end)
See Also
- createEffect
- fxAddBlood
- fxAddBulletImpact
- fxAddBulletSplash
- fxAddDebris
- fxAddFootSplash
- fxAddGlass
- fxAddGunshot
- fxAddPunchImpact
- fxAddSparks
- fxAddTankFire
- fxAddTyreBurst
- fxAddWaterHydrant
- fxAddWaterSplash
- fxAddWood
- getEffectDensity
- getEffectSpeed
- setEffectDensity
- setEffectSpeed