Пример #1
0
        /// <summary>
        /// Drop all player weapons. Mostly used by on death events.
        /// </summary>
        /// <param name="client"></param>
        public static void DropAllWeapons(Client client)
        {
            Account account = RetrieveAccount(client);

            if (account.Weapons == "")
            {
                return;
            }

            client.RemoveAllWeapons();
            List <WeaponHash> equipment = JsonConvert.DeserializeObject <List <WeaponHash> >(account.Weapons);

            account.Weapons = "";
            UpdateAccount(client);

            foreach (WeaponHash item in equipment)
            {
                InventoryHandler.AddDroppedItemToGround(client, new InventoryItem
                {
                    Name        = item.ToString(),
                    StackCount  = 1,
                    IsStackable = false
                });
            }
        }