Beispiel #1
0
 public Angels()
 {
     name = "Hells Angels";
     type = Type.Angels;
     location = new Vector3(72f, 3709.72f, 39.32f);
     addVehicle(VehicleHash.Hexer,
         VehicleHash.Bagger,
         VehicleHash.Daemon,
         VehicleHash.Sovereign);
     addModel(PedHash.GentransportSMM,
         PedHash.OldMan1aCutscene,
         PedHash.Salton01AMO,
         PedHash.Lost03GMY,
         PedHash.TerryCutscene,
         PedHash.Lost02GMY,
         PedHash.ExArmy01,
         PedHash.Lost01GMY,
         PedHash.Taphillbilly,
         PedHash.Salton01AMY,
         PedHash.JohnnyKlebitzCutscene,
         PedHash.Lost01GMY);
     addMeleeWeapon(WeaponHash.KnuckleDuster,
         WeaponHash.Hammer,
         WeaponHash.Nightstick);
     addRangedWeapon(WeaponHash.CarbineRifle,
         WeaponHash.DoubleBarrelShotgun,
         WeaponHash.AssaultShotgun);
 }
        /// <summary>
        /// Start fire at the position. Stop after the specified time has passed.
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="timeoutAfterDeath"></param>
        public bool AddTimedScriptFire(Vector3 position, int timeout)
        {
            if (activeFires.Count > 30) { for (int i = 0; i < 5; i++) { activeFires[i].StopFire(); activeFires.RemoveAt(i); } }

            activeFires.Add(new ScriptFire(position, 0, true, timeout));
            return true;
        }
Beispiel #3
0
 public Yakuza()
 {
     name = "Asian Yakuza";
     type = Type.Yakuza;
     location = new Vector3(1134.89f, -1289.24f, 34.16f);
     addVehicle(VehicleHash.Cognoscenti,
         VehicleHash.Jackal,
         VehicleHash.Superd);//TODO niet zeker over Superd (moet zijn Enus Super Diamond)
     addModel(PedHash.ChiCold01GMM,
         //PedHash.Ktown01GMO, //TODO bestaat niet?
         PedHash.Vinewood01AFY,
         PedHash.Ktown02AMY,
         PedHash.KorBoss01GMM,
         PedHash.TaosTranslatorCutscene,
         PedHash.KorLieut01GMY,
         PedHash.ChiGoon01GMM,
         PedHash.TaoChengCutscene,
         PedHash.Korean02GMY,
         PedHash.WeiCheng,
         PedHash.ChiBoss01GMM,
         PedHash.Business01AMY,
         PedHash.Ktown01AMM,
         PedHash.HaoCutscene,
         PedHash.Jewelass01);
     addMeleeWeapon(WeaponHash.Dagger,
         WeaponHash.Hatchet);
     addRangedWeapon(WeaponHash.VintagePistol,
         WeaponHash.CombatPistol,
         WeaponHash.SMG);
 }
Beispiel #4
0
 public Maffia()
 {
     name = "Italian Maffia";
     type = Type.Maffia;
     location = new Vector3(-1859.85f, 221.71f, 84.29f);
     addVehicle(VehicleHash.Monroe,
         VehicleHash.Ztype,
         VehicleHash.Peyote,
         VehicleHash.Casco,
         VehicleHash.BType,
         VehicleHash.JB700);
     addModel(PedHash.Bestmen,
         PedHash.PaperCutscene,
         PedHash.GroomCutscene,
         PedHash.MoviePremMaleCutscene,
         PedHash.Bankman,
         PedHash.Hacker,
         PedHash.MiltonCutscene,
         PedHash.Bankman01,
         PedHash.PrologueMournMale01,
         PedHash.Movprem01SMM,
         PedHash.JewelThief,
         PedHash.Abner,
         PedHash.ArmBoss01GMM,
         PedHash.ArmGoon01GMM);
     addMeleeWeapon(WeaponHash.SwitchBlade,
         WeaponHash.Crowbar);
     addRangedWeapon(WeaponHash.Gusenberg,
         WeaponHash.VintagePistol,
         WeaponHash.MG);
 }
 public Gangsters()
 {
     name = "American Gangsters";
     type = Type.Gang;
     location = new Vector3(102.02f, -1939.01f, 20.39f);
     addVehicle(VehicleHash.Picador,
         VehicleHash.Chino,
         VehicleHash.Blade,
         VehicleHash.Manana,
         VehicleHash.Cruiser,
         VehicleHash.Bmx);
     addModel(PedHash.BallaOrig01GMY,
         PedHash.BallaSout01GMY,
         PedHash.Families01GFY,
         PedHash.PrisMuscl01SMY,
         PedHash.Famfor01GMY,
         PedHash.Claypain,
         PedHash.Ballasog,
         PedHash.RampGangCutscene,
         PedHash.Soucent04AMM,
         PedHash.Soucent03AMY,
         PedHash.Stbla01AMY,
         PedHash.Dealer01SMY,
         PedHash.RampGang,
         PedHash.Highsec01SMM,
         PedHash.BallaEast01GMY,
         PedHash.StrPunk01GMY);
     addMeleeWeapon(WeaponHash.Bat,
         WeaponHash.Knife,
         WeaponHash.SwitchBlade);
     addRangedWeapon(WeaponHash.Pistol,
         WeaponHash.MicroSMG,
         WeaponHash.PumpShotgun,
         WeaponHash.AssaultRifle);
 }
Beispiel #6
0
        /// <summary>
        /// Checks whether the world event can start at the position depending on available peds.
        /// </summary>
        /// <param name="position">
        /// The position.
        /// </param>
        /// <returns>
        /// True if yes, otherwise false.
        /// </returns>
        public override bool CanStart(Vector3 position)
        {
            // Look for peds meeting our requirements. Note that it is also completely fine to just always return true here and create the peds yourself.
            // But since we don't want to stress the game too much I'm using this approach for all world events, so they can only occur if the game has
            // created ambient peds anyway.
            foreach (Ped ped in World.GetAllPeds())
            {
                if (ped != null && ped.Exists())
                {
                    if (ped.Position.DistanceTo(position) < 30f)
                    {
                        LPed tempPed = LPed.FromGTAPed(ped);
                        if (!Functions.DoesPedHaveAnOwner(tempPed) && !tempPed.IsPlayer && tempPed.IsAliveAndWell && !tempPed.IsOnStreet
                            && !ped.isInVehicle())
                        {
                            if (this.firstGuy == null)
                            {
                                this.firstGuy = tempPed;
                            }
                            else
                            {
                                this.secondGuy = tempPed;
                                return true;
                            }
                        }
                    }
                }
            }

            return false;
        }
Beispiel #7
0
        public void AddSequentialBomb()
        {
            if (bombs.Count < 1)
            {
                var rot = new Vector3(80.0f, 0.0f, vehicle.Heading + 180.0f);
                var mBomb = new Bomb(vehicle.GetOffsetInWorldCoords(dropOffset), rot);
                mBomb.Velocity = vehicle.Velocity + new Vector3(0, 0, -5f);
                bombs.Add(mBomb);
            }

            else
            {
                var prevRot = bombs[bombs.Count - 1].Rotation;

                if (prevRot.X < 79.1)
                {
                    prevRot.X += 4.0f;
                    if (prevRot.X > 79.1)
                        prevRot.X = 79.1f;
                    bombs[bombs.Count - 1].Rotation = prevRot;
                }

                var rot = new Vector3(80.0f, 0.0f, vehicle.Heading + 180.0f);
                var mBomb = new Bomb(vehicle.GetOffsetInWorldCoords(dropOffset), rot);
                mBomb.Velocity = bombs[bombs.Count - 1].Velocity;
                bombs.Add(mBomb);
            }
        }
 public DeliveryStep(Vector3 l, params MyEntity[] entity)
 {
     location = l;
     foreach (MyEntity e in entity)
     {
         AddTarget(e);
     }
 }
 public StreamedVehicle(VehicleStreamer streamer, string model, Vector3 position, Quaternion orientation)
     : base(streamer)
 {
     this.model = model;
     this.position = position;
     spawn_position = position;
     this.orientation = orientation;
     spawn_orientation = orientation;
 }
 /// <summary>
 /// Initialize the class
 /// </summary>
 /// <param name="baseVehicle">Target vehicle</param>
 /// <param name="dropInterval">Interval between flares</param>
 /// <param name="maxDropTime">Max time to drop flares</param>
 /// <param name="dropOffset">Spawn offset relative to base vehicle</param>
 /// <param name="forceType">The type of directional force to apply on spawn</param>
 /// <param name="forceMultiplier">Force multiplier</param>
 public IRFlareSequence(Vehicle baseVehicle, int dropInterval, int maxDropTime, Vector3 dropOffset, ForceType forceType, float forceMultiplier)
 {
     this.baseVehicle = baseVehicle;
     this.dropInterval = dropInterval;
     this.maxDropTime = maxDropTime;
     this.dropOffset = dropOffset;
     this.forceType = forceType;
     this.forceMultiplier = forceMultiplier;
 }
Beispiel #11
0
 public CarpetBomb(Vehicle vehicle, Vector3 dropOffset)
 {
     this.vehicle = vehicle;
     this.dropTimer = new Timer(300);
     this.dropOffset = dropOffset;
     this.updatedVel = new Vector3();
     this.bombs = new List<Bomb>();
     this.bombsDropped = 0;
     this.bombSoundID = -1;
 }
Beispiel #12
0
 // Exemple:
 // DemagoMenu.drawText( "Hello world", 0.14, 0.49, 2.9, true, 1, 255, 0, 0 );
 public UITextElement( string text, double x, double y, double scale, bool center, Font font, Vector3 color )
 {
     this.text = text;
     this.x = x;
     this.y = y;
     this.scale = scale;
     this.center = center;
     this.font = (int)font;
     this.color = color;
 }
 public void Launch(Vector3 targetPosition)
 {
     var missile = new HomingMissile(targetPosition);
     if (missile.Exists)
     {
         _missiles.Add(missile);
     }
     else
     {
         missile.Dispose();
     }
 }
Beispiel #14
0
        public static BlipObject QuestArea(string name, Vector3 position)
        {
            var blip = World.CreateBlip(position);

            var blipObj = new BlipObject(name, blip);
            RPG.WorldData.AddBlip(blipObj);

            blip.Scale = 3f;
            blip.Sprite = BlipSprite.GTAOMission;
            blip.Color = BlipColor.Green;
            blip.Alpha = 180;
            return blipObj;
        }
Beispiel #15
0
        private static int Create(Vector3 position, Vector3 rotation)
        {
            var model = new Model("prop_ld_bomb_01");
            if (!model.IsLoaded)
                model.Request(1000);

            var mBomb = World.CreateProp(model, position, false, false);
            Function.Call(Hash.SET_ENTITY_RECORDS_COLLISIONS, mBomb.Handle, true);
            Function.Call(Hash.SET_ENTITY_LOAD_COLLISION_FLAG, mBomb.Handle, true);
            Function.Call(Hash.SET_ENTITY_LOD_DIST, mBomb.Handle, 1000);
            mBomb.Rotation = rotation;
            return mBomb.Handle;
        }
        public static Ped SpawnCompanion(PedHash pedHash, Vector3 location, int groupId)
        {
            var ped = GTA.World.CreatePed(pedHash, location);
            ped.IsPersistent = true;
            ped.RelationshipGroup = groupId;
            ped.NeverLeavesGroup = true;

            var blip = ped.AddBlip();
            blip.IsFriendly = true;
            blip.Scale = 0.5f;

            return ped;
        }
Beispiel #17
0
 public HUDText(string text, int value, Entity ent, Vector3 position, Color mainColor, Color textColor, GTA.Font font = GTA.Font.Monospace, Vector3? startOffset = null)
 {
     this.text = text;
     this.value = value;
     this.entity = ent;
     this.position = position;
     this.mainColor = mainColor;
     this.textColor = textColor;
     this.font = font;
     this.startOffset = startOffset;
     this.moveOffset = new PointF(0.0f, 0.005f);
     this.displayTimer = new Timer(100);
     this.fadeTimer = new Timer(1000);
     this.display = true;
     displayTimer.Start();
 }
Beispiel #18
0
        public void Draw()
        {
            if (startOffset != null)
                position += startOffset.Value;

            Function.Call(Hash.SET_DRAW_ORIGIN, position.X, position.Y, position.Z, 0);
            var uiText = new UIText(string.Format("x{0}", value), Point.Empty, 0.8f, mainColor, font, false);
            uiText.Draw();

            if (text != null)
            {
                uiText = new UIText(text, new Point(0, 29), 0.66F, textColor, Font.ChaletComprimeCologne, false);
                uiText.Draw();
            }

            Function.Call(Hash.CLEAR_DRAW_ORIGIN);
        }
 public override bool NeedRestream()
 {
     if (gameReference.Health == 0 && !will_respawn)
     {
         will_respawn = true;
         var timer = new Timer(6000);
         timer.Tick += (o, e) =>
         {
             position = spawn_position;
             orientation = spawn_orientation;
             if (IsStreamedIn()) StreamOut();
             timer.Stop();
         };
         timer.Start();
     }
     return false;
 }
Beispiel #20
0
		public Rival(Vector3 pos, float heading, Model car)
		{
			Character = World.CreateRandomPed(pos);
			Vehicle = World.CreateVehicle(car, pos, heading);
			Function.Call(Hash.SET_PED_INTO_VEHICLE, Character.Handle, Vehicle.Handle, (int)VehicleSeat.Driver);
			Vehicle.IsPersistent = false;
			Vehicle.FreezePosition = true;

            Function.Call(Hash.SET_VEHICLE_MOD_KIT, Vehicle.Handle, 0);
            Vehicle.SetMod(VehicleMod.Engine, 3, false);
            Vehicle.SetMod(VehicleMod.Brakes, 2, false);
            Vehicle.SetMod(VehicleMod.Transmission, 2, false);
            Vehicle.SetMod(VehicleMod.Suspension, 3, false);
            
			Character.MaxDrivingSpeed = 500f;
			Character.DrivingStyle = (DrivingStyle)MainDrivingStyle;
			Character.DrivingSpeed = 200f;
            Function.Call(Hash.SET_DRIVER_ABILITY, Character.Handle, 100f);
        }
Beispiel #21
0
 public Cartel()
 {
     name = "Mexican Cartel";
     type = Type.Cartel;
     location = new Vector3(848.31f, -2342.78f, 30.33f);
     addVehicle(VehicleHash.Patriot,
         VehicleHash.Rebel,
         VehicleHash.Technical,
         VehicleHash.Sandking,
         VehicleHash.Sandking2,
         VehicleHash.Guardian,
         VehicleHash.Bison);
     addModel(PedHash.SalvaGoon03GMY,
         PedHash.MexGoon01GMY,
         PedHash.SalvaGoon01GMY,
         PedHash.MexThug01AMY,
         PedHash.MexGoon02GMY,
         PedHash.SalvaGoon02GMY,
         PedHash.MexBoss02GMM,
         PedHash.PoloGoon01GMY,
         PedHash.Azteca01GMY,
         PedHash.SalvaBoss01GMY,
         PedHash.MexGoon03GMY,
         PedHash.PoloGoon02GMY,
         PedHash.MexGang01GMY,
         PedHash.ArmGoon02GMY,
         PedHash.Beachvesp02AMY,
         PedHash.OscarCutscene,
         PedHash.RampMexCutscene,
         PedHash.VagosSpeak);
     addMeleeWeapon(WeaponHash.Bottle);
     addRangedWeapon(WeaponHash.SawnOffShotgun,
         WeaponHash.VintagePistol,
         WeaponHash.AssaultRifle,
         WeaponHash.SniperRifle);
 }
Beispiel #22
0
        public Teammate(Vector3 spawnpoint)
        {
            World.SetRelationshipBetweenGroups(Relationship.Respect, NOOSEGroup, Game.Player.Character.RelationshipGroup);

            World.SetRelationshipBetweenGroups(Relationship.Hate, NOOSEGroup, Enemy.EnemyGroup);
            World.SetRelationshipBetweenGroups(Relationship.Hate, Enemy.EnemyGroup, NOOSEGroup);

            var swatmodel = new Model(PedHash.Swat01SMY);
            int counter = 0;
            do
            {
                swatmodel.Request();
                Script.Yield();
                counter++;
            } while (!swatmodel.IsLoaded && counter < 10000);

            Character = Function.Call<Ped>(Hash.CREATE_PED, 26, swatmodel.Hash, spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 0f, false, false);
            Character.Health = 200;
            Character.Armor = 200;
            Character.RelationshipGroup = NOOSEGroup;
            Character.AlwaysDiesOnLowHealth = false;
            Function.Call(Hash.REMOVE_PED_FROM_GROUP, Character.Handle);
            Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, Character.Handle, Function.Call<int>(Hash.GET_PED_GROUP_INDEX, Game.Player.Character.Handle));
        }
Beispiel #23
0
 public Bomb(Vector3 position, Vector3 rotation)
     : base(Create(position, rotation))
 {
 }
 public Member CreateMember(Vector3 p, Member.WeaponType w, bool d, Vehicle v = null)
 {
     return CreateMember(this, p, w, d, v);
 }
        /// <summary>
        /// Remove the particle FX in range
        /// </summary>
        public void Remove(Vector3 position, float radius)
        {
            if (Handle == -1) return;

            Function.Call(Hash.REMOVE_PARTICLE_FX_IN_RANGE, position.X, position.Y,  position.Z, radius);
            Handle = -1;
        }
 public void LookAt(Vector3 position)
 {
     if (camera == null) createCamera();
     camera.LookAt(position);
 }
 public InterpolatingCamera(Vector3 position)
 {
     mainCamera = World.CreateCamera(position, new Vector3(), 50f);
     mainCamera.Position = position;
 }
 public TravelStep(Vector3 l)
     : base(l)
 {
 }
Beispiel #29
0
        public void StartConvoyDrivingRoutine(Vector3 destination)
        {
            leader.DriveTo(destination);

            for (int i = 0; i < children.Count; i++)
            {
                if (i == 0)
                    children[i].StartFollow(leader);
                else
                children[i].StartFollow(children[i - 1]);

            }
        }
Beispiel #30
0
        public void Update()
        {
            if (dropTimer.Enabled && Game.GameTime > dropTimer.Waiter)
            {
                if (bombsDropped < 10)
                {
                    AddSequentialBomb();
                    bombsDropped++;

                    if (bombsDropped == 10)
                        bombs[bombs.Count - 1].IsVisible = false;

                    dropTimer.Reset();
                }

                else
                {
                    dropTimer.Enabled = false;
                    bombsDropped = 0;
                }
            }

            if (bombs.Count < 2) return;

            for (int i = 0; i < bombs.Count; i++)
            {
                if (!Function.Call<bool>((Hash)0xE9676F61BC0B3321, bombs[i].Handle))
                {
                    Function.Call(Hash.REQUEST_COLLISION_AT_COORD, bombs[i].Position.X, bombs[i].Position.Y, bombs[i].Position.Z);
                }

                if (Function.Call<bool>(Hash.HAS_ENTITY_COLLIDED_WITH_ANYTHING, bombs[i].Handle) || bombs[i].IsInWater)
                {
                    DestroyActiveSounds();
                    if (bombs[i].Position.DistanceTo(vehicle.Position) > 15f)
                        PlayExplosion(bombs[i]);
                    bombs[i].Delete();
                    bombs.RemoveAt(i);
                    continue;
                }

                if (i == bombs.Count - 1)
                    break;

                OutputArgument arg1, arg2, arg3, arg4;
                arg1 = arg2 = arg3 = arg4 = new OutputArgument();

                float velocityZ = -60.0f;
                float velMultiplier = -5.0f;

                if (bombs[i + 1].HeightAboveGround > 150.0f)
                {
                    velocityZ = -70.0f;
                    velMultiplier = -10.0f;
                }

                if (!bombs[i + 1].IsDead)
                {
                    updatedVel = bombs[i + 1].Velocity;
                    Function.Call(Hash.GET_ENTITY_MATRIX, bombs[i + 1].Handle, arg1, arg2, arg3, arg4);
                }

                var result = arg3.GetResult<Vector3>();

                var vMag = Function.Call<float>(Hash.VMAG, result.X, result.Y, result.Z);
                if (vMag != 0.0)
                    result *= 1.0f / vMag;

                updatedVel += result * velMultiplier;

                if (updatedVel.Z <= velocityZ)
                    updatedVel.Z = velocityZ;

                if (Function.Call<bool>(Hash.DOES_ENTITY_HAVE_PHYSICS, bombs[i].Handle))
                    Function.Call(Hash.SET_ENTITY_MAX_SPEED, bombs[i].Handle, 90.0f);

                bombs[i].Velocity = updatedVel;
            }
        }