Ejemplo n.º 1
0
        public static void ChangeBackWeapon(Client player, ItemType type, bool remove)
        {
            if (!nInventory.WeaponsItems.Contains(type))
            {
                return;
            }

            Dictionary <string, uint> weaponsOnBody = player.GetData("WEAPONS_ON_BODY");

            if (!weaponsOnBody.ContainsKey(WeaponsSlots[type]))
            {
                return;
            }

            if (remove)
            {
                if (weaponsOnBody[WeaponsSlots[type]] == nInventory.ItemModels[type])
                {
                    BasicSync.AddAttachmnet(player, nInventory.ItemModels[type], true);
                    weaponsOnBody[WeaponsSlots[type]] = 0;
                }
            }
            else
            {
                if (weaponsOnBody[WeaponsSlots[type]] == 0)
                {
                    BasicSync.AddAttachmnet(player, nInventory.ItemModels[type], false);
                    weaponsOnBody[WeaponsSlots[type]] = nInventory.ItemModels[type];
                }
            }

            player.SetData("WEAPONS_ON_BODY", weaponsOnBody);
        }