Graphics::startParticleFxNonLoopedOnPedBone: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
No edit summary
 
Line 1: Line 1:
GRAPHICS::START_PARTICLE_FX_NON_LOOPED_ON_PED_BONE('scr_sh_bong_smoke', PLAYER::PLAYER_PED_ID(), -0.025f, 0.13f, 0f, 0f, 0f, 0f, 31086, 0x3F800000, 0, 0, 0);<br><br>Axis - Invert Axis Flags<br><br>list: pastebin.com/N9unUFWY
{{ClientsideJsFunction}}
==Syntax==
{{JSContainer|
<syntaxhighlight lang="javascript">mp.game.graphics.startParticleFxNonLoopedOnPedBone(effectName, ped, offsetX, offsetY, offsetZ, rotX, rotY, rotZ, boneIndex, scale, axisX, axisY, axisZ);</syntaxhighlight>
 
=== Required Arguments ===
=== Summary ===
*'''effectName:''' String
Triggers a non-looped particle effect on a specific bone of a ped. The particle's position, rotation, and scale can be customized, along with axis inversion flags.
*'''ped:''' Ped handle or object
 
*'''offsetX:''' float
=== Syntax ===
*'''offsetY:''' float
*'''offsetZ:''' float
*'''rotX:''' float
*'''rotY:''' float
*'''rotZ:''' float
*'''boneIndex:''' int
*'''scale:''' float
*'''axisX:''' Boolean
*'''axisY:''' Boolean
*'''axisZ:''' Boolean
===Return value===
*'''Boolean'''
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
mp.game.graphics.startParticleFxNonLoopedOnPedBone(effectName, ped, offsetX, offsetY, offsetZ, rotX, rotY, rotZ, boneIndex, scale, axisX, axisY, axisZ);
</syntaxhighlight>
</syntaxhighlight>
==See also==
 
=== Required Parameters ===
* '''effectName:''' {{RageType|String}} - The name of the particle effect to play.
* '''ped:''' {{RageType|Ped}} - The ped handle or object on which the effect will be played.
* '''offsetX:''' {{RageType|float}} - X-axis offset from the bone.
* '''offsetY:''' {{RageType|float}} - Y-axis offset from the bone.
* '''offsetZ:''' {{RageType|float}} - Z-axis offset from the bone.
* '''rotX:''' {{RageType|float}} - Rotation around the X-axis.
* '''rotY:''' {{RageType|float}} - Rotation around the Y-axis.
* '''rotZ:''' {{RageType|float}} - Rotation around the Z-axis.
* '''boneIndex:''' {{RageType|int}} - Index of the ped's bone where the effect is applied.
* '''scale:''' {{RageType|float}} - The scale of the particle effect.
* '''axisX:''' {{RageType|Boolean}} - Inverts the effect along the X-axis if true.
* '''axisY:''' {{RageType|Boolean}} - Inverts the effect along the Y-axis if true.
* '''axisZ:''' {{RageType|Boolean}} - Inverts the effect along the Z-axis if true.
 
=== Return Value ===
* '''{{RageType|Boolean}}''' - Returns true if the effect was successfully started.
 
=== Example ===
This example spawns a particle effect ("scr_sh_bong_smoke") on the player's head bone.
<syntaxhighlight lang="javascript">
const ped = mp.players.local.handle;
const boneIndex = 31086; // Head bone index
const effectName = "scr_sh_bong_smoke";
 
mp.game.graphics.startParticleFxNonLoopedOnPedBone(
    effectName,
    ped,
    -0.025, 0.13, 0.0, // Offsets
    0.0, 0.0, 0.0, // Rotations
    boneIndex,
    1.0, // Scale
    false, false, false // No axis inversion
);
 
mp.gui.chat.push(`Particle effect "${effectName}" started on ped's head.`);
</syntaxhighlight>
}}
 
== See Also ==
{{Graphics_s_function_c}}
{{Graphics_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 13:35, 4 December 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Summary

Triggers a non-looped particle effect on a specific bone of a ped. The particle's position, rotation, and scale can be customized, along with axis inversion flags.

Syntax

mp.game.graphics.startParticleFxNonLoopedOnPedBone(effectName, ped, offsetX, offsetY, offsetZ, rotX, rotY, rotZ, boneIndex, scale, axisX, axisY, axisZ);

Required Parameters

  • effectName: String - The name of the particle effect to play.
  • ped: Ped - The ped handle or object on which the effect will be played.
  • offsetX: float - X-axis offset from the bone.
  • offsetY: float - Y-axis offset from the bone.
  • offsetZ: float - Z-axis offset from the bone.
  • rotX: float - Rotation around the X-axis.
  • rotY: float - Rotation around the Y-axis.
  • rotZ: float - Rotation around the Z-axis.
  • boneIndex: int - Index of the ped's bone where the effect is applied.
  • scale: float - The scale of the particle effect.
  • axisX: Boolean - Inverts the effect along the X-axis if true.
  • axisY: Boolean - Inverts the effect along the Y-axis if true.
  • axisZ: Boolean - Inverts the effect along the Z-axis if true.

Return Value

  • 'Boolean' - Returns true if the effect was successfully started.

Example

This example spawns a particle effect ("scr_sh_bong_smoke") on the player's head bone.

const ped = mp.players.local.handle;
const boneIndex = 31086; // Head bone index
const effectName = "scr_sh_bong_smoke";

mp.game.graphics.startParticleFxNonLoopedOnPedBone(
    effectName,
    ped,
    -0.025, 0.13, 0.0, // Offsets
    0.0, 0.0, 0.0, // Rotations
    boneIndex,
    1.0, // Scale
    false, false, false // No axis inversion
);

mp.gui.chat.push(`Particle effect "${effectName}" started on ped's head.`);


See Also