示例#1
0
        public static void dropDrillBag(Client player)
        {
            if (Main.Players[player].InsideHouseID != -1 || Main.Players[player].InsideGarageID != -1)
            {
                Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не можете сделать это, находясь в доме/гараже", 3000);
                return;
            }

            var pos = NAPI.Entity.GetEntityPosition(player);

            player.SetClothes(5, 0, 0);
            var drillbag = NAPI.Object.CreateObject(-651206088, player.Position + new Vector3(0, 0, -1.1), player.Rotation + new Vector3(0, 30, 110), 255, 0);

            drillbag.SetSharedData("TYPE", "DrillBag");
            drillbag.SetSharedData("PICKEDT", false);
            player.ResetData("HEIST_DRILL");
            var item = nInventory.Find(Main.Players[player].UUID, ItemType.BagWithDrill);

            GameLog.Items($"player({Main.Players[player].UUID})", "ground", Convert.ToInt32(ItemType.BagWithDrill), 1, $"{item.Data}");
            nInventory.Remove(player, ItemType.BagWithDrill, 1);
        }
示例#2
0
        public static void dropMoneyBag(Client player)
        {
            if (Main.Players[player].InsideHouseID != -1 || Main.Players[player].InsideGarageID != -1)
            {
                Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не можете сделать это, находясь в доме/гараже", 3000);
                return;
            }

            var pos = NAPI.Entity.GetEntityPosition(player);

            var money = -1;

            foreach (var item in nInventory.Items[Main.Players[player].UUID])
            {
                if (item.Type != ItemType.BagWithMoney)
                {
                    continue;
                }
                money = Convert.ToInt32(item.Data);
                nInventory.Remove(player, item);
                break;
            }
            if (money == -1)
            {
                return;
            }

            player.SetClothes(5, 0, 0);
            var money_bag = NAPI.Object.CreateObject(-711724000, player.Position + new Vector3(0, 0, -1.15), player.Rotation + new Vector3(90, 0, 0), 255, 0);

            money_bag.SetSharedData("TYPE", "MoneyBag");
            money_bag.SetSharedData("PICKEDT", false);
            NAPI.Data.SetEntityData(money_bag, "MONEY_IN_BAG", money);

            player.ResetData("HAND_MONEY");
            GameLog.Items($"player({Main.Players[player].UUID})", "ground", Convert.ToInt32(ItemType.BagWithMoney), 1, $"{money}");
        }