I am creating a Ped and making it follow a TaskSequence.
List<Vector3> Locations = GetLocationToRunTo();//returns list of vectors that i want my Ped to follow
TaskSequence sequence = new TaskSequence();
Now I want to know at what all times the player is doing the Task "FollowPointRoute",
so that when it ends, I want to make some calculations and make the Ped follow another PointRoute and so on.
What I tried, (GET_IS_TASK_ACTIVE)
bool flag = Function.Call<bool>(Hash.GET_IS_TASK_ACTIVE, Ped, (int)209);
But it always returns false.
Just to check if this native function is working I tried,
added additional tasks, like jump or hands up.
for (int value = 0; value <= 1000; ++value)
bool flag2 = Function.Call<bool>(Hash.GET_IS_TASK_ACTIVE, Ped, (int)value);
if (flag2 == true)
UI.Notify("Flag2 : " + flag2.ToString() + " : " + value.ToString());
Just as expected, it returned true for values 0,420,421.(0 for hands up, 420,421 for jump)
What I tried, (GET_SCRIPT_TASK_STATUS)
int nextflag = Function.Call<int>Hash.GET_SCRIPT_TASK_STATUS, Ped, 0xb232526f);
But this always returns '7', meaning the specified task is not assigned to the ped.
Similarly to last try, I added Hands up and Jump tasks to check if this native function is working properly,
TASK_HANDS_UP - 0xa573b67c
TASK_JUMP - 0x24415046
But it always returns 7, irrespective of GET_SCRIPT_TASK_STATUS task hashes.
So, there is something wrong in what I am trying to do, or the native function is not working properly or task hashes or not updated ?.
Note : the above functions are used "OnTick", to check in every frame for the specified task is running or not.