[c#] open_sequence_task


Hello everyone! I have problems with using OPEN_SEQUENCE_TASK/CLOSE_SEQUENCE_TASK/TASK_PERFORM_SEQUENCE/CLEAR_SEQUENCE_TASK in my client-side plugin. When im trying to use OPEN_SEQUENCE_TASK i get error:

InvokeNative: execution failed: Error executing native 0xe8854a4326b9e12b at address 0x140cfead2

I need to use this natives for animation script. This is trouble part of it:

int zero = 0;
var sequence = Function.Call<int>(Hash.OPEN_SEQUENCE_TASK, zero);  <== ERROR
Function.Call(Hash.TASK_PLAY_ANIM, bla bla bla);
Function.Call(Hash.CLOSE_SEQUENCE_TASK, sequence);

I would appreciate any help.


Here’s a basic example but it does not use Function.Call.
You have to create your task sequence first, then add animations to it, and finally perform that sequence on a PED where applicable.

TaskSequence reviveAnim = new TaskSequence();
reviveAnim.AddTask.PlayAnimation("get_up@directional@transition@prone_to_knees@injured", "front");
reviveAnim.AddTask.PlayAnimation("get_up@directional@movement@from_knees@injured", "getup_r_180");


Its seems work for now. Thank you very much!


Hello again, i cant firgure up how to use TaskSequence() with Play Advanced Animation. I would appreciate any help.


Not sure I understand what you mean by “Advanced Animation”.

.AddTask.PlayAnimation() has 4 overloads where you can change things like the blend in, blend out, duration, animation flags, and play back rate if that’s what you mean by ‘advanced’.


I mean TaskPlayAnimAdvanced


It doesn’t look like you can use that in sequence, however when looking at the native the only added options it has that don’t exist in at least one of the PlayAnimation() overloads is the x, y, z coords which documentation states will just teleport the PED to those coords before playing the animation. You can just script that part yourself to either teleport them or task them to go to, walk to, run to, etc, if they are close to the coord anyways. Then wait until they are at that coord and start the sequence. Likewise you can also change the ped heading, etc, once they get to the coord or use task look at, etc.


Thank you again, anders.


FYI: to use a task in a task sequence, just replace the ped with -1.


Thank you for reply.