예제 #1
0
 public override void Update()
 {
     if (!(_prop == null))
     {
         TryInteract(_prop);
         UpdateTimer();
         if (!CantSeeCrate())
         {
             Blip blip = _prop.AddBlip();
             if (!(blip == null))
             {
                 blip.Sprite = GTA.BlipSprite.CrateDrop;
                 blip.Color  = GTA.BlipColor.Yellow;
                 blip.Name   = "Crate Drop";
                 _blip.Remove();
                 _peds.ForEach(delegate(Ped ped)
                 {
                     Blip val  = ped.AddBlip();
                     val.Color = GTA.BlipColor.Yellow;
                     val.Name  = "Merryweather Security";
                 });
             }
         }
     }
 }
예제 #2
0
 // Spawn blip for Prop
 public static Blip SpawnPropBlip(Prop propName, BlipSprite sprite, int blipColour, bool showroute)
 {
     // Add blip to vehicle
     propName.AddBlip();
     // Give blip an icon
     propName.CurrentBlip.Sprite = sprite;
     // Set GPS route for blip on/off
     propName.CurrentBlip.ShowRoute = showroute;
     // Set colour of blip
     Function.Call(Hash.SET_BLIP_COLOUR, propName.CurrentBlip, blipColour);
     // Set colour of GPS route
     Function.Call(Hash.SET_BLIP_ROUTE_COLOUR, propName.CurrentBlip, blipColour);
     return(propName.CurrentBlip);
 }
예제 #3
0
        // Turn mod on/off
        private void modActivate()
        {
            if (Mod_Menu.modActivator() == 2)
            {
                modActive = true;
                on        = 1;

                Game.Player.Character.Health    = 300;
                Game.Player.Character.MaxHealth = 300;

                spear = World.CreateProp("prop_fnccorgm_02pole", Game.Player.Character.Position + new Vector3(-15, -15, -5), false, false);

                spear.AddBlip();
                spear.CurrentBlip.Color = BlipColor.White;
                spear.CurrentBlip.Scale = 0.7f;
                spear.CurrentBlip.Name  = "Spear";

                if (finToggle == true)
                {
                    fin = World.CreateProp("prop_proxy_hat_01", Game.Player.Character.Position + new Vector3(0, 0, 0), false, false);
                    fin.AttachTo(Game.Player.Character, Game.Player.Character.GetBoneIndex(Bone.SKEL_Head),
                                 new Vector3(0.15f, -0.01f, 0.005f),
                                 new Vector3(0, 90, -25)
                                 );
                }

                UI.ShowSubtitle("~r~Active~w~");
            }
            else
            {
                modActive = false;
                on        = 0;

                spear.CurrentBlip.Remove();
                spear.Delete();

                if (finToggle == true)
                {
                    fin.Delete();
                }

                Game.Player.Character.CanRagdoll = true;

                UI.ShowSubtitle("~w~Deactive~w~");
            }
        }
예제 #4
0
 private unsafe void LoadProps()
 {
     if (_map.Count > 0)
     {
         foreach (MapProp item in _map)
         {
             Model model = item.PropName;
             if (!model.Request(1000))
             {
                 UI.Notify($"Tried to request ~y~{item.PropName}~s~ but failed.");
             }
             else
             {
                 Vector3 position = item.Position;
                 Prop    val      = new Prop(Function.Call <int>(GTA.Native.Hash.CREATE_OBJECT_NO_OFFSET, (InputArgument[])new InputArgument[7]
                 {
                     model.Hash,
                     position.X,
                     position.Y,
                     position.Z,
                     1,
                     1,
                     false
                 }));
                 val.FreezePosition = !item.IsDoor;
                 val.Rotation       = item.Rotation;
                 Prop prop = val;
                 item.Handle = prop.Handle;
                 if ((int)item.BlipSprite != 1)
                 {
                     Blip blip = prop.AddBlip();
                     blip.Sprite = item.BlipSprite;
                     blip.Color  = item.BlipColor;
                     blip.Name   = item.Id;
                     ZombieVehicleSpawner.Instance.SpawnBlocker.Add(item.Position);
                 }
             }
         }
     }
 }
예제 #5
0
        // Mod Active
        private void modActivate()
        {
            try {
                if (Mod_Menu.modActivator() == 1)
                {
                    modActive = true;
                    on        = 1;

                    Game.Player.Character.Health    = 300;
                    Game.Player.Character.MaxHealth = 300;

                    dagger = World.CreateProp(model, Game.Player.Character.Position, false, false);
                    dagger.AddBlip();
                    dagger.CurrentBlip.Color = BlipColor.Yellow;
                    dagger.CurrentBlip.Scale = 0.7f;
                    dagger.CurrentBlip.Name  = "Dagger";

                    if (mask)
                    {
                        // mask setup
                        // maskCircle
                        maskCircle = World.CreateProp("w_ar_specialcarbine_boxmag", Game.Player.Character.Position, false, false);
                        maskCircle.AttachTo(Game.Player.Character, Game.Player.Character.GetBoneIndex(Bone.SKEL_Head),
                                            new Vector3(-0.0078f, 0.0622f, -0.0001f),
                                            new Vector3(93f, 167.38f, -105.7735f)
                                            );

                        // maskMiddle
                        maskMiddle = World.CreateProp("w_ar_specialcarbine_mag1", Game.Player.Character.Position, false, false);
                        maskMiddle.AttachTo(Game.Player.Character, Game.Player.Character.GetBoneIndex(Bone.SKEL_Head),
                                            new Vector3(0.0175f, 0.1272f, -0.0851f),
                                            new Vector3(-1.6061f, -179.1025f, 20.5556f)
                                            );

                        // maskLeft
                        maskLeft = World.CreateProp("w_pi_vintage_pistol_mag1", Game.Player.Character.Position, false, false);
                        maskLeft.AttachTo(Game.Player.Character, Game.Player.Character.GetBoneIndex(Bone.SKEL_Head),
                                          new Vector3(0.0316f, 0.0427f, -0.0667f),
                                          new Vector3(-78.9061f, 9.7856f, -119.2810f)
                                          );

                        // maskRight
                        maskRight = World.CreateProp("w_pi_vintage_pistol_mag1", Game.Player.Character.Position, false, false);
                        maskRight.AttachTo(Game.Player.Character, Game.Player.Character.GetBoneIndex(Bone.SKEL_Head),
                                           new Vector3(0.0316f, 0.0427f, 0.0703f),
                                           new Vector3(-96.9061f, 5.7856f, -128.2810f)
                                           );
                    }

                    UI.ShowSubtitle("~o~Active~w~");
                }
                else
                {
                    modActive = false;
                    on        = 0;

                    dagger.Delete();
                    dagger.CurrentBlip.Remove();

                    if (mask)
                    {
                        maskCircle.Delete();
                        maskMiddle.Delete();
                        maskLeft.Delete();
                        maskRight.Delete();
                    }

                    Game.Player.Character.CanRagdoll = true;

                    UI.ShowSubtitle("~w~Deactive~w~");
                }
            } catch { Exception why; }
        }
        public void Setup()
        {
            playerOldMaxWantedLevel = Game.MaxWantedLevel;
            playerOldMoney          = Game.Player.Money;
            playerOldPosition       = Game.Player.Character.Position;
            playerOldHeading        = Game.Player.Character.Heading;
            playerOldModel          = Game.Player.Character.Model;
            playerOldWeapons        = Game.Player.Character.Weapons;
            Game.MaxWantedLevel     = 0;
            Game.Player.WantedLevel = 0;
            Game.Player.Money       = 0;
            Model characterModel;

            PedHash[] characterMaleModels   = { PedHash.FreemodeMale01 };
            PedHash[] characterFemaleModels = { PedHash.FreemodeFemale01 };
            PedHash[] characterModels;
            if (playerGender == Gender.Male)
            {
                characterModels = characterMaleModels;
            }
            else
            {
                characterModels = characterFemaleModels;
            }
            characterModel = new Model(RandoMath.GetRandomElementFromArray(characterModels));
            characterModel.Request(500);
            if (characterModel.IsInCdImage && characterModel.IsValid)
            {
                while (!characterModel.IsLoaded)
                {
                    Script.Wait(100);
                }
                Function.Call(Hash.SET_PLAYER_MODEL, Game.Player, characterModel.Hash);
                if (playerGender == Gender.Male)
                {
                    Function.Call(Hash.SET_PED_HEAD_BLEND_DATA, Game.Player.Character.Handle, 44, 44, 0, 44, 44, 0, 1.0f, 1.0f, 0.0f, true);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 3, 12, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 4, 1, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 8, 0, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 11, 233, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 6, 24, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 2, 12, 0, 0);
                    Function.Call(Hash._SET_PED_HAIR_COLOR, Game.Player.Character.Handle, 57, 58);
                    Function.Call(Hash._SET_PED_EYE_COLOR, Game.Player.Character.Handle, 3);
                    Function.Call(Hash.SET_PED_HEAD_OVERLAY, Game.Player.Character.Handle, 1, 0, 1.0f);
                    Function.Call(Hash.SET_PED_HEAD_OVERLAY, Game.Player.Character.Handle, 2, 1, 1.0f);
                    Function.Call(Hash._SET_PED_HEAD_OVERLAY_COLOR, Game.Player.Character.Handle, 1, 1, 57, 58);
                    Function.Call(Hash._SET_PED_HEAD_OVERLAY_COLOR, Game.Player.Character.Handle, 2, 1, 57, 58);
                }
                else
                {
                    Function.Call(Hash.SET_PED_HEAD_BLEND_DATA, Game.Player.Character.Handle, 33, 33, 0, 33, 33, 0, 1.0f, 1.0f, 0.0f, true);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 2, 4, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 11, 243, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 3, 7, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 8, 0, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 6, 24, 0, 0);
                    Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character.Handle, 4, 84, 0, 0);
                    Function.Call(Hash._SET_PED_HAIR_COLOR, Game.Player.Character.Handle, 11, 11);
                    Function.Call(Hash._SET_PED_EYE_COLOR, Game.Player.Character.Handle, 3);
                    Function.Call(Hash.SET_PED_HEAD_OVERLAY, Game.Player.Character.Handle, 2, 1, 1.0f);
                    Function.Call(Hash._SET_PED_HEAD_OVERLAY_COLOR, Game.Player.Character.Handle, 2, 1, 11, 11);
                }
            }
            characterModel.MarkAsNoLongerNeeded();
            Game.Player.Money = 0;
            Game.Player.Character.Position = new Vector3(478.8616f, -921.53f, 38.77953f);
            Game.Player.Character.Heading  = 266;
            var model = new Model("prop_beach_fire");

            model.Request(250);
            if (model.IsInCdImage && model.IsValid)
            {
                while (!model.IsLoaded)
                {
                    Script.Wait(50);
                }
                var CFpos = new Vector3(482.3683f, -921.3369f, 37.2f);
                campFire = World.CreateProp(model, CFpos, true, false);
            }
            model.MarkAsNoLongerNeeded();
            campFire.AddBlip();
            campFire.CurrentBlip.Sprite = (BlipSprite)436;
            campFire.CurrentBlip.Color  = BlipColor.Yellow;
            campFire.CurrentBlip.Name   = "Campfire";
            var model2 = new Model("prop_skid_tent_01");

            model2.Request(250);
            if (model2.IsInCdImage && model2.IsValid)
            {
                while (!model2.IsLoaded)
                {
                    Script.Wait(50);
                }
                var Tpos = new Vector3(478.2682f, -925.3043f, 36.8f);
                tent         = World.CreateProp(model2, Tpos, true, false);
                tent.Heading = 135;
            }
            model2.MarkAsNoLongerNeeded();
            tent.AddBlip();
            tent.CurrentBlip.Sprite = BlipSprite.CaptureHouse;
            tent.CurrentBlip.Color  = BlipColor.Blue;
            tent.CurrentBlip.Name   = "Tent";
            var model3 = new Model("prop_const_fence02a");

            model3.Request(250);
            if (model3.IsInCdImage && model3.IsValid)
            {
                while (!model3.IsLoaded)
                {
                    Script.Wait(50);
                }
                var Bpos = new Vector3(418.9457f, -890.5727f, 28.4f);
                barrier         = World.CreateProp(model3, Bpos, true, false);
                barrier.Heading = 270;
            }
            model3.MarkAsNoLongerNeeded();
            var model4 = new Model("prop_dumpster_02a");

            model4.Request(250);
            if (model4.IsInCdImage && model4.IsValid)
            {
                while (!model4.IsLoaded)
                {
                    Script.Wait(50);
                }
                var Dpos = new Vector3(459.4905f, -933.745f, 31.2f);
                dumpster         = World.CreateProp(model4, Dpos, true, false);
                dumpster.Heading = 270;
            }
            model4.MarkAsNoLongerNeeded();
            ResetCharacter();
        }
예제 #7
0
        public void Setup()
        {
            this.playerOldMaxWantedLevel = Game.MaxWantedLevel;
            this.playerOldMoney          = Game.Player.Money;
            this.playerOldPosition       = Game.Player.Character.Position;
            this.playerOldHeading        = Game.Player.Character.Heading;
            this.playerOldModel          = Game.Player.Character.Model;
            this.playerOldWeapons        = Game.Player.Character.Weapons;
            Game.MaxWantedLevel          = 0;
            Game.Player.WantedLevel      = 0;
            Game.Player.Money            = 0;
            PedHash[] hashArray  = new PedHash[] { PedHash.FreemodeMale01 };
            PedHash[] hashArray2 = new PedHash[] { (PedHash)(-1667301416) };
            PedHash[] theArray   = (playerGender != Gender.Male) ? hashArray2 : hashArray;
            Model     model      = new Model(RandoMath.GetRandomElementFromArray <PedHash>(theArray));

            model.Request(500);
            if (model.IsInCdImage && model.IsValid)
            {
                while (true)
                {
                    if (model.IsLoaded)
                    {
                        InputArgument[] arguments = new InputArgument[] { Game.Player, model.Hash };
                        Function.Call(Hash._0x00A1CADD00108836, arguments);
                        if (playerGender != Gender.Male)
                        {
                            InputArgument[] argumentArray15 = new InputArgument[11];
                            argumentArray15[0]  = Game.Player.Character.Handle;
                            argumentArray15[1]  = 0x21;
                            argumentArray15[2]  = 0x21;
                            argumentArray15[3]  = 0;
                            argumentArray15[4]  = 0x21;
                            argumentArray15[5]  = 0x21;
                            argumentArray15[6]  = 0;
                            argumentArray15[7]  = 1f;
                            argumentArray15[8]  = 1f;
                            argumentArray15[9]  = 0f;
                            argumentArray15[10] = true;
                            Function.Call(Hash._0x9414E18B9434C2FE, argumentArray15);
                            InputArgument[] argumentArray16 = new InputArgument[] { Game.Player.Character.Handle, 2, 4, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray16);
                            InputArgument[] argumentArray17 = new InputArgument[] { Game.Player.Character.Handle, 11, 0xf3, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray17);
                            InputArgument[] argumentArray18 = new InputArgument[] { Game.Player.Character.Handle, 3, 7, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray18);
                            InputArgument[] argumentArray19 = new InputArgument[] { Game.Player.Character.Handle, 8, 0, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray19);
                            InputArgument[] argumentArray20 = new InputArgument[] { Game.Player.Character.Handle, 6, 0x18, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray20);
                            InputArgument[] argumentArray21 = new InputArgument[] { Game.Player.Character.Handle, 4, 0x54, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray21);
                            InputArgument[] argumentArray22 = new InputArgument[] { Game.Player.Character.Handle, 11, 11 };
                            Function.Call(Hash._0x4CFFC65454C93A49, argumentArray22);
                            InputArgument[] argumentArray23 = new InputArgument[] { Game.Player.Character.Handle, 3 };
                            Function.Call(Hash._0x50B56988B170AFDF, argumentArray23);
                            InputArgument[] argumentArray24 = new InputArgument[] { Game.Player.Character.Handle, 2, 1, 1f };
                            Function.Call(Hash._0x48F44967FA05CC1E, argumentArray24);
                            InputArgument[] argumentArray25 = new InputArgument[] { Game.Player.Character.Handle, 2, 1, 11, 11 };
                            Function.Call(Hash._0x497BF74A7B9CB952, argumentArray25);
                        }
                        else
                        {
                            InputArgument[] argumentArray2 = new InputArgument[11];
                            argumentArray2[0]  = Game.Player.Character.Handle;
                            argumentArray2[1]  = 0x2c;
                            argumentArray2[2]  = 0x2c;
                            argumentArray2[3]  = 0;
                            argumentArray2[4]  = 0x2c;
                            argumentArray2[5]  = 0x2c;
                            argumentArray2[6]  = 0;
                            argumentArray2[7]  = 1f;
                            argumentArray2[8]  = 1f;
                            argumentArray2[9]  = 0f;
                            argumentArray2[10] = true;
                            Function.Call(Hash._0x9414E18B9434C2FE, argumentArray2);
                            InputArgument[] argumentArray3 = new InputArgument[] { Game.Player.Character.Handle, 3, 12, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray3);
                            InputArgument[] argumentArray4 = new InputArgument[] { Game.Player.Character.Handle, 4, 1, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray4);
                            InputArgument[] argumentArray5 = new InputArgument[] { Game.Player.Character.Handle, 8, 0, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray5);
                            InputArgument[] argumentArray6 = new InputArgument[] { Game.Player.Character.Handle, 11, 0xe9, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray6);
                            InputArgument[] argumentArray7 = new InputArgument[] { Game.Player.Character.Handle, 6, 0x18, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray7);
                            InputArgument[] argumentArray8 = new InputArgument[] { Game.Player.Character.Handle, 2, 12, 0, 0 };
                            Function.Call(Hash._0x262B14F48D29DE80, argumentArray8);
                            InputArgument[] argumentArray9 = new InputArgument[] { Game.Player.Character.Handle, 0x39, 0x3a };
                            Function.Call(Hash._0x4CFFC65454C93A49, argumentArray9);
                            InputArgument[] argumentArray10 = new InputArgument[] { Game.Player.Character.Handle, 3 };
                            Function.Call(Hash._0x50B56988B170AFDF, argumentArray10);
                            InputArgument[] argumentArray11 = new InputArgument[] { Game.Player.Character.Handle, 1, 0, 1f };
                            Function.Call(Hash._0x48F44967FA05CC1E, argumentArray11);
                            InputArgument[] argumentArray12 = new InputArgument[] { Game.Player.Character.Handle, 2, 1, 1f };
                            Function.Call(Hash._0x48F44967FA05CC1E, argumentArray12);
                            InputArgument[] argumentArray13 = new InputArgument[] { Game.Player.Character.Handle, 1, 1, 0x39, 0x3a };
                            Function.Call(Hash._0x497BF74A7B9CB952, argumentArray13);
                            InputArgument[] argumentArray14 = new InputArgument[] { Game.Player.Character.Handle, 2, 1, 0x39, 0x3a };
                            Function.Call(Hash._0x497BF74A7B9CB952, argumentArray14);
                        }
                        break;
                    }
                    Script.Wait(100);
                }
            }
            model.MarkAsNoLongerNeeded();
            Game.Player.Money = 0;
            Game.Player.Character.Position = new Vector3(478.8616f, -921.53f, 38.77953f);
            Game.Player.Character.Heading  = 266f;
            Model model2 = new Model("prop_beach_fire");

            model2.Request(250);
            if (model2.IsInCdImage && model2.IsValid)
            {
                while (true)
                {
                    if (model2.IsLoaded)
                    {
                        Vector3 position = new Vector3(482.3683f, -921.3369f, 37.2f);
                        campFire = World.CreateProp(model2, position, true, false);
                        break;
                    }
                    Script.Wait(50);
                }
            }
            model2.MarkAsNoLongerNeeded();
            campFire.AddBlip();
            campFire.CurrentBlip.Sprite = BlipSprite.HotProperty;
            campFire.CurrentBlip.Color  = BlipColor.Yellow;
            campFire.CurrentBlip.Name   = "Campfire";
            Model model3 = new Model("prop_skid_tent_01");

            model3.Request(250);
            if (model3.IsInCdImage && model3.IsValid)
            {
                while (true)
                {
                    if (model3.IsLoaded)
                    {
                        Vector3 position = new Vector3(478.2682f, -925.3043f, 36.8f);
                        tent         = World.CreateProp(model3, position, true, false);
                        tent.Heading = 135f;
                        break;
                    }
                    Script.Wait(50);
                }
            }
            model3.MarkAsNoLongerNeeded();
            tent.AddBlip();
            tent.CurrentBlip.Sprite = BlipSprite.CaptureHouse;
            tent.CurrentBlip.Color  = BlipColor.Blue;
            tent.CurrentBlip.Name   = "Tent";
            Model model4 = new Model("prop_const_fence02a");

            model4.Request(250);
            if (model4.IsInCdImage && model4.IsValid)
            {
                while (true)
                {
                    if (model4.IsLoaded)
                    {
                        Vector3 position = new Vector3(418.9457f, -890.5727f, 28.4f);
                        barrier         = World.CreateProp(model4, position, true, false);
                        barrier.Heading = 270f;
                        break;
                    }
                    Script.Wait(50);
                }
            }
            model4.MarkAsNoLongerNeeded();
            Model model5 = new Model("prop_dumpster_02a");

            model5.Request(250);
            if (model5.IsInCdImage && model5.IsValid)
            {
                while (true)
                {
                    if (model5.IsLoaded)
                    {
                        Vector3 position = new Vector3(459.4905f, -933.745f, 31.2f);
                        dumpster         = World.CreateProp(model5, position, true, false);
                        dumpster.Heading = 270f;
                        break;
                    }
                    Script.Wait(50);
                }
            }
            model5.MarkAsNoLongerNeeded();
            this.ResetCharacter();
        }