Exemple #1
0
        public TreasureHunting()
        {
            Instance = this;
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
            SetupItems();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
            EventHandlers["TreasureHuntingLooted"] += new Action <Player, int>(TreasureWasLooted);
            EventHandlers["SellAllTreasureLoot"]   += new Action <Player>(SellLoot);
        }
Exemple #2
0
        public TreasureHunting()
        {
            Instance = this;
            SetupBlips();
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
            DrawMarkers();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
            LootLogic();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

            ButtonLogic();

            InteractionMenu.Instance._interactionMenu.OnItemSelect += async(sender, item, index) =>
            {
                if (item == _button)
                {
                    if (_atSellPoint)
                    {
                        InteractionMenu.Instance._interactionMenuPool.CloseAllMenus();
                        TriggerServerEvent("SellAllTreasureLoot");
                    }
                    else
                    {
                        InteractionMenu.Instance._interactionMenuPool.CloseAllMenus();
                        _nearbyLocation.CanLoot = false;
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                        ResetLootability(_nearbyLocation);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                        async Task ResetLootability(TreasureLocation loc)
                        {
                            await Delay(60000);

                            loc.CanLoot = true;
                        }

                        Game.PlayerPed.Task.PlayAnimation("mini@repair", "fixing_a_player");
                        await Delay(1750);

                        Game.PlayerPed.Task.ClearAll();
                        TriggerServerEvent("TreasureHuntingLooted", _locations.IndexOf(_nearbyLocation));
                    }
                }
            };
        }