Exemplo n.º 1
0
        /// <summary>
        /// Setup fighter for the local player.
        /// </summary>
        public void Setup()
        {
            var vehModel = new Model(VehicleHash.Lazer);

            if (!vehModel.IsLoaded)
                vehModel.Request(1000);

            //Create the vehicle
            var vehicle = new ManageableVehicle(World.CreateVehicle(vehModel, Team.JetSpawnPoint.Position));
            vehicle.Heading = Team.JetSpawnPoint.Heading;

            vehicle.Vehicle.EngineRunning = true;
            vehicle.IsInvincible = true;
            vehicle.MaxSpeed = 110;
            ManagedVehicle = vehicle;
            ManagedVehicle.EnterWater += EnterWater;

            irFlares = new IRFlareManager();

            irFlares.SetupWithVehicle(ManagedVehicle.Vehicle);

            //Handle the ped
            var ped = new ManageablePed(Game.Player.Character);
            ped.Ped.RelationshipGroup = Team.RelationshipGroup;
            ped.Ped.SetIntoVehicle(vehicle.Vehicle, VehicleSeat.Driver);
            ped.IsInvincible = true;

            ManagedPed = ped;
            ManagedPed.ExitVehicle += ExitVehicle;

            interpCam = new InterpolatingCamera(vehicle.GetOffsetInWorldCoords(new Vector3(-2f, -2f, 10f)));
            interpCam.MainCamera.PointAt(vehicle);
            interpCam.Start();

            engineFX1 = new LoopedPTFX("core", "ent_sht_extinguisher");
            engineSound = new GameSound("SPRAY", "CARWASH_SOUNDS");

            boostTimer.Start();
        }
Exemplo n.º 2
0
        public void AddChildren(int count = 0)
        {
            var spawnPos = leader.Team.GroundSpawnPoint.Position;
            var pedModel = new Model(PedHash.Pilot02SMM);
            var vehModel = new Model(VehicleHash.Barracks3);

            if (!pedModel.IsLoaded)
                pedModel.Request(1000);

            if (!vehModel.IsLoaded)
                vehModel.Request(1000);

            for (int i = 0; i < count; i++)
            {
                var parent = children.Count > 0 ? children.Last() : leader ;

                var childAsset = new GroundAI();
                var pos = parent.ManagedVehicle.Position - parent.ManagedVehicle.ForwardVector * 6;
                var vehicle = new ManageableVehicle(World.CreateVehicle(vehModel, pos));

                vehicle.Vehicle.EngineRunning = true;
                vehicle.Vehicle.Heading = leader.Team.GroundSpawnPoint.Heading;
                vehicle.AddBlip();
                vehicle.CurrentBlip.Sprite = BlipSprite.BountyHit;

                Function.Call(Hash.SET_ENTITY_LOAD_COLLISION_FLAG, vehicle.Handle, true);

                var ped = new ManageablePed(new Ped(Function.Call<int>(Hash.CREATE_PED_INSIDE_VEHICLE, vehicle.Handle, 6, pedModel.Hash, -1, 0, 0)));
                ped.Ped.RelationshipGroup = leader.Team.RelationshipGroup;
                ped.Ped.BlockPermanentEvents = false;
                ped.Ped.SetIntoVehicle(vehicle.Vehicle, VehicleSeat.Driver);

                childAsset.Manage(ped, vehicle);
                children.Add(childAsset);
            }
        }
Exemplo n.º 3
0
        public AIConvoy Setup(int children)
        {
            leader = new GroundAI();
            TeamManager.SetupTeam(this);

            var spawnPos = leader.Team.GroundSpawnPoint.Position;
            var pedModel = new Model(PedHash.Pilot02SMM);
            var vehModel = new Model(VehicleHash.Barracks);

            var vehicle = new ManageableVehicle(World.CreateVehicle(vehModel, spawnPos));

            vehicle.Vehicle.EngineRunning = true;
            vehicle.Vehicle.Heading = leader.Team.GroundSpawnPoint.Heading;

            vehicle.AddBlip();
            vehicle.CurrentBlip.Sprite = BlipSprite.BountyHit;

            var ped = new ManageablePed(World.CreatePed(pedModel, spawnPos));
            ped.Ped.RelationshipGroup = leader.Team.RelationshipGroup;
            ped.Ped.BlockPermanentEvents = false;
            ped.Ped.SetIntoVehicle(vehicle.Vehicle, VehicleSeat.Driver);

            leader.Manage(ped, vehicle);

            AddChildren(children);

            return this;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Assign a ManageablePed and ManageableVehicle object to this ground asset.
 /// </summary>
 /// <param name="Pilot"></param>
 /// <param name="Vehicle"></param>
 /// <returns></returns>
 public GroundAI Manage(ManageablePed Driver, ManageableVehicle Vehicle)
 {
     ped = Driver;
     vehicle = Vehicle;
     return this;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Assign a ManageablePed and ManageableVehicle object to this fighter.
 /// </summary>
 /// <param name="Pilot"></param>
 /// <param name="Vehicle"></param>
 /// <returns></returns>
 public ActiveFighter Manage(ManageablePed Pilot, ManageableVehicle Vehicle)
 {
     ped = Pilot;
     vehicle = Vehicle;
     return this;
 }