natives.taskPlayAnimWithFlags

From GTA Connected
Revision as of 23:55, 3 December 2025 by ChrisGame20 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Client Only icon-iv.png Online and Offline

Available since Client 1.0.0

void natives.taskPlayAnimWithFlags(int ped, string animName, string animDict, float speed, int flag, int duration)

The natives.taskPlayAnimWithFlags function is used to Play an animation on a ped with specific flags and duration.

Parameters

1) int ped The ped handle.
2) string animName The animation name ("armsup_loop").
3) string animDict The animation dictionary ("cop").
4) float speed The playback speed (default 8.0).
5) int flag Control flag (blend/priority, usually 0).
6) int duration Duration of the animation (-1 for infinite loop).

Return

void This function doesn't return a value.

Notes

There aren't any notes for this function.

Examples

Example 1 - JavaScript:

addCommandHandler("handsup", function(command, params, client) {

   const ped = localPlayer.ped;
   if (ped) {
       // Play the hands up animation in infinite loop
       natives.taskPlayAnimWithFlags(ped, "armsup_loop", "cop", 8.0, 0, -1);
   }

});

Compatibility

There isn't any compatibility information for this function.