AFAIK, this is the Menyoo Function:
Need to research the natives behind:
spe.LastAnimation.dict.clear();
spe.LastAnimation.name.clear();
Note: the solution unfortunately does not involve simply "clearing" tasks - at least not on its own. Don't know why it's only certain scenarios that only work once per session.
void stopScenarioPls()
{
GTAped ped = Static_241;
GTAentity att;
auto spi = sub::Spooner::EntityManagement::GetEntityIndexInDb(ped);
if (spi >= 0)
{
auto& spe = sub::Spooner::Databases::EntityDb[spi];
Spooner::EntityManagement::GetEntityThisEntityIsAttachedTo(spe.Handle, att);
}
GTAvehicle veh = ped.CurrentVehicle();
bool isInVehicle = veh.Exists();
VehicleSeat vehSeat;
if (isInVehicle)
{
vehSeat = ped.CurrentVehicleSeat_get();
}
ped.Task().ClearAllImmediately();
if (isInVehicle)
{
ped.SetIntoVehicle(veh, vehSeat);
}
if (spi >= 0)
{
auto& spe = sub::Spooner::Databases::EntityDb[spi];
spe.LastAnimation.dict.clear();
spe.LastAnimation.name.clear();
if (att.Exists() && spe.AttachmentArgs.isAttached)
spe.Handle.AttachTo(att, spe.AttachmentArgs.boneIndex, spe.Handle.IsCollisionEnabled_get(), spe.AttachmentArgs.offset, spe.AttachmentArgs.rotation);
spe.TaskSequence.Reset();
if (sub::Spooner::SelectedEntity.Handle.Equals(spe.Handle))
{
sub::Spooner::SelectedEntity.LastAnimation.dict = spe.LastAnimation.dict;
sub::Spooner::SelectedEntity.LastAnimation.name = spe.LastAnimation.name;
sub::Spooner::SelectedEntity.TaskSequence = spe.TaskSequence;
}
}
}