Example #1
0
        public void setClothesFromString(SharpBridge.Player player)
        {
            Dictionary <uint, uint> dic = new Dictionary <uint, uint>();

            string[] pieces = user.clothes.Split(' ');
            try
            {
                if (pieces.Length >= 1)
                {
                    player.setSkinId(uint.Parse(pieces[0]));
                }

                for (uint i = 1; i < pieces.Length; i++)
                {
                    string[] parts = pieces[i].Split(',');
                    if (parts.Length != 2)
                    {
                        continue;
                    }

                    uint part = uint.Parse(parts[0]);
                    uint id   = uint.Parse(parts[1]);

                    if (part < 10)
                    {
                        player.setClothes(part, id);
                    }
                    else
                    {
                        player.setProperty(part - 10, id);
                    }
                }
            }
            catch (Exception) { }
        }
        public static void ChangeSkin(SharpBridge.Player player, object[] param)
        {
            uint id = (uint)param[0];

            if (id > 350)
            {
                player.sendMsg($"{id} is not a valid skin ID", ChatColor.ERROR);
                return;
            }
            player.setSkinId(id);
        }