GetRandomPosition() 정적인 개인적인 메소드

Generated a random Vector3 with the given min and max values
static private GetRandomPosition ( int min = 200, int max = 750 ) : Vector3
min int
max int
리턴 Vector3
예제 #1
0
        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);
            }
        }
예제 #2
0
 public SlowVehicle()
 {
     InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(Utils.GetRandomPosition())));
     ShortName          = "Slow vehicle";
     CalloutDescription = "";
     ResponseCode       = 2;
     StartDistance      = 120f;
 }
예제 #3
0
 public UnconsciousPerson()
 {
     InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(Utils.GetRandomPosition())));
     ShortName          = "Unconscious person";
     CalloutDescription = "";
     ResponseCode       = 3;
     StartDistance      = 200f;
 }
예제 #4
0
 public Mugging()
 {
     InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(Utils.GetRandomPosition())));
     ShortName          = "Mugging";
     CalloutDescription = "";
     ResponseCode       = 3;
     StartDistance      = 120f;
 }
예제 #5
0
 public ActiveShooters()
 {
     InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(Utils.GetRandomPosition(300, 800))));
     ShortName          = "Active shooters";
     CalloutDescription = "";
     ResponseCode       = 3;
     StartDistance      = 150f;
 }