natives.taskPlayAnimWithFlags: Difference between revisions
Jump to navigation
Jump to search
ChrisGame20 (talk | contribs) (Created page with "{{ScriptItem |endpoint = client |games = iv |type = function |name = natives.taskPlayAnimWithFlags |parameters = int ped, string animName, string animDict, float speed, int flag, int duration |parameter1 = int ped The ped handle |parameter2 = string animName The animation name (e.g. "armsup_loop") |parameter3 = string animDict The animation dictionary (e.g. "cop") |parameter4 = float speed The playback speed (default 8.0) |parameter5 = int flag Control flag (blend/priori...") |
(No difference)
|
Revision as of 23:55, 3 December 2025
Function Client Only ![]()
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 (e.g. "armsup_loop"). |
| 3) | string | animDict | The animation dictionary (e.g. "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.