Code:
if (e.KeyCode == Keys.E)
{
Native.Function.Call(Native.Hash.REQUEST_ANIM_DICT, "anim_dict_here");
Wait(50);
Ped[] NearbyPeds = World.GetNearbyPeds(Game.Player.Character,20f);
foreach(Ped p in NearbyPeds)
{
p.Task.ClearAllTasks();
p.Task.PlayAnimation(p,"ANIM_NAME","ANIM_DICT",8.0 , 8.0*-1 , -1 , 0 , 0 , false, false, false);
}
}
A lot of the variables in the PlayAnimation command are unknown, so if you want to figure out the different animation speeds and types, here's a link to GTA X Scripting
Animation dictionary list: Animation Dictionary