private async Task DoTheAction(Ped ped, List <Ped> pedsToShoot) { Ped pedToShoot = pedsToShoot == null?Utilities.GetClosestPed(ped) : ped.GetClosestPedFromPedList(pedsToShoot); if (pedToShoot == null || pedToShoot.IsDead) { return; } int chance = Utils.rnd.Next(10); if (chance >= 0 && chance <= 5) { ped.Task.ShootAt(pedToShoot); } else { Vector3 pos = ped.GetOffsetPosition(Utils.GetRandomPosition(5, 25)); ped.Task.RunTo(pos); while (World.GetDistance(pos, ped.Position) >= 3f) { await BaseScript.Delay(10); } ped.Task.ShootAt(pedToShoot); } }
public SlowVehicle() { InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(Utils.GetRandomPosition()))); ShortName = "Slow vehicle"; CalloutDescription = ""; ResponseCode = 2; StartDistance = 120f; }
public UnconsciousPerson() { InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(Utils.GetRandomPosition()))); ShortName = "Unconscious person"; CalloutDescription = ""; ResponseCode = 3; StartDistance = 200f; }
public Mugging() { InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(Utils.GetRandomPosition()))); ShortName = "Mugging"; CalloutDescription = ""; ResponseCode = 3; StartDistance = 120f; }
public ActiveShooters() { InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(Utils.GetRandomPosition(300, 800)))); ShortName = "Active shooters"; CalloutDescription = ""; ResponseCode = 3; StartDistance = 150f; }