fxAddBulletImpact | Multi Theft Auto: Wiki Skip to content

fxAddBulletImpact

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Creates a bullet impact particle effect, consisting of a small smoke cloud and a number of sparks.

OOP Syntax Help! I don't understand this!

Syntax

bool fxAddBulletImpact ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ, [ int smokeSize = 1, int sparkCount = 1, float smokeIntensity = 1.0 ] )
Required Arguments
  • posX: MISSING_PARAM_DESC
  • posY: MISSING_PARAM_DESC
  • posZ: MISSING_PARAM_DESC
  • dirX: MISSING_PARAM_DESC
  • dirY: MISSING_PARAM_DESC
  • dirZ: MISSING_PARAM_DESC
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • smokeSize (default: 1): the size of the smoke cloud.
  • sparkCount (default: 1): the number of sparks to create.
  • smokeIntensity (default: 1.0): the amount/transparency of smoke, ranges from 0 to 1.

Returns

  • bool: value

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

Code Examples

shared

This example will create a Bullet Impact Effect on the position of the bullet impact.

addEventHandler("onClientPlayerWeaponFire", root, function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement)
if weapon == 0 then return end -- If the player is unarmed, return end.
fxAddBulletImpact(hitX, hitY, hitZ, 0, 0, 0, math.random(1, 2), math.random(2, 5), 1.0)
end)