Пример #1
0
        internal static List <Ped> SpawnCops(Vector3 spawnPoint, int number, bool isBusy, bool kill, out List <PedType> pedTypeList)
        {
            var array    = GetPeds(spawnPoint);
            var typeList = new List <PedType>();
            var list     = new List <Ped>();

            for (var i = 0; i < number; i++)
            {
                var cop = new Ped(new Model(array[Fiskey111Common.Rand.RandomNumber(array.Length)]), spawnPoint.Around2D(2f), 0f);
                Functions.SetPedAsCop(cop);
                Functions.SetCopAsBusy(cop, isBusy);
                cop.Inventory.GiveNewWeapon(
                    new WeaponAsset(
                        Settings.CopWeaponAssets()[
                            Fiskey111Common.Rand.RandomNumber(Settings.CopWeaponAssets().Length)]), 400, true);
                cop.MakeMissionPed();
                EntityMethods.CheckIfOnVehicle(cop);

                typeList.Add(new PedType(cop, PedType.Type.Cop, cop.Inventory.EquippedWeaponObject));
                list.Add(cop);

                if (kill)
                {
                    cop.Kill();
                }
            }

            pedTypeList = typeList;
            return(list);
        }
Пример #2
0
        internal static List <Ped> SpawnPeds(Vector3 spawnPoint, string model, int number, float around1, float around2, float heading)
        {
            var list     = new List <Ped>();
            var ped      = new Ped();
            var position = World.GetNextPositionOnStreet(spawnPoint.Around2D(around1, around2));

            for (var l = 0; l < number; l++)
            {
                ped = model == null ? new Ped(position) : new Ped(new Model(model), position, heading);

                EntityMethods.CheckIfOnVehicle(ped);
                ped.MakeMissionPed();
                list.Add(ped);
            }
            return(list);
        }