FxAddTankFire: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 17: Line 17:


==Example==
==Example==
This page lacks an example
<section name="Client" class="client" show="true">
This example will create a Tank Fire Effect at your weapon's muzzle position
 
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--add an example here
addEventHandler("onClientPlayerWeaponFire", root, function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement)
    if weapon == 0 then return end -- If the player is unarmed, return end.
    local mX, mY, mZ = getPedWeaponMuzzlePosition(localPlayer)
    fxAddTankFire(mX, mY, mZ, 0, 90, 0)
end)
</syntaxhighlight>
</syntaxhighlight>
</section>


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

Revision as of 13:11, 25 May 2012

Tank fire

This function creates a tank firing particle effect.

Syntax

bool fxAddTankFire ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ )

Required Arguments

  • posX, posY, posZ: the world coordinates where the effect originates.
  • dirX, dirY, dirZ: a direction vector indicating where the tank fire is directed to.

Returns

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

Example

Click to collapse [-]
Client

This example will create a Tank Fire Effect at your weapon's muzzle position

addEventHandler("onClientPlayerWeaponFire", root, function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement)
    if weapon == 0 then return end -- If the player is unarmed, return end.
    local mX, mY, mZ = getPedWeaponMuzzlePosition(localPlayer)
    fxAddTankFire(mX, mY, mZ, 0, 90, 0)
end)

See Also